diff --git a/azure-mgmt-workloadmonitor/HISTORY.rst b/azure-mgmt-workloadmonitor/HISTORY.rst new file mode 100644 index 000000000000..2cda4e88a4d0 --- /dev/null +++ b/azure-mgmt-workloadmonitor/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (2019-02-15) +++++++++++++++++++ + +* Initial Release diff --git a/azure-mgmt-workloadmonitor/MANIFEST.in b/azure-mgmt-workloadmonitor/MANIFEST.in new file mode 100644 index 000000000000..6ceb27f7a96e --- /dev/null +++ b/azure-mgmt-workloadmonitor/MANIFEST.in @@ -0,0 +1,4 @@ +include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-workloadmonitor/README.rst b/azure-mgmt-workloadmonitor/README.rst new file mode 100644 index 000000000000..416648a6f8eb --- /dev/null +++ b/azure-mgmt-workloadmonitor/README.rst @@ -0,0 +1,30 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure Workload Monitor Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Usage +===== + +For code examples, see `Workload Monitor +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. diff --git a/azure-mgmt-workloadmonitor/azure/__init__.py b/azure-mgmt-workloadmonitor/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/__init__.py b/azure-mgmt-workloadmonitor/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/__init__.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/__init__.py new file mode 100644 index 000000000000..d436675fbd6a --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/__init__.py @@ -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 .workload_monitor_api import WorkloadMonitorAPI +from .version import VERSION + +__all__ = ['WorkloadMonitorAPI'] + +__version__ = VERSION + diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/__init__.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/__init__.py new file mode 100644 index 000000000000..2be1bc82819f --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/__init__.py @@ -0,0 +1,86 @@ +# 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 .monitor_criteria_py3 import MonitorCriteria + from .monitor_py3 import Monitor + from .component_py3 import Component + from .health_state_change_py3 import HealthStateChange + from .monitor_instance_py3 import MonitorInstance + from .notification_setting_py3 import NotificationSetting + from .operation_properties_py3 import OperationProperties + from .operation_py3 import Operation + from .error_field_contract_py3 import ErrorFieldContract + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .tracked_resource_py3 import TrackedResource + from .azure_entity_resource_py3 import AzureEntityResource + from .resource_py3 import Resource + from .proxy_resource_py3 import ProxyResource +except (SyntaxError, ImportError): + from .monitor_criteria import MonitorCriteria + from .monitor import Monitor + from .component import Component + from .health_state_change import HealthStateChange + from .monitor_instance import MonitorInstance + from .notification_setting import NotificationSetting + from .operation_properties import OperationProperties + from .operation import Operation + from .error_field_contract import ErrorFieldContract + from .error_response import ErrorResponse, ErrorResponseException + from .tracked_resource import TrackedResource + from .azure_entity_resource import AzureEntityResource + from .resource import Resource + from .proxy_resource import ProxyResource +from .monitor_paged import MonitorPaged +from .component_paged import ComponentPaged +from .monitor_instance_paged import MonitorInstancePaged +from .notification_setting_paged import NotificationSettingPaged +from .operation_paged import OperationPaged +from .workload_monitor_api_enums import ( + MonitorType, + MonitorCategory, + MonitorState, + HealthState, + Operator, + AlertGeneration, + WorkloadType, + HealthStateCategory, +) + +__all__ = [ + 'MonitorCriteria', + 'Monitor', + 'Component', + 'HealthStateChange', + 'MonitorInstance', + 'NotificationSetting', + 'OperationProperties', + 'Operation', + 'ErrorFieldContract', + 'ErrorResponse', 'ErrorResponseException', + 'TrackedResource', + 'AzureEntityResource', + 'Resource', + 'ProxyResource', + 'MonitorPaged', + 'ComponentPaged', + 'MonitorInstancePaged', + 'NotificationSettingPaged', + 'OperationPaged', + 'MonitorType', + 'MonitorCategory', + 'MonitorState', + 'HealthState', + 'Operator', + 'AlertGeneration', + 'WorkloadType', + 'HealthStateCategory', +] diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/azure_entity_resource.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/azure_entity_resource.py new file mode 100644 index 000000000000..3bffaab8d35b --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/azure_entity_resource.py @@ -0,0 +1,50 @@ +# 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 .resource import Resource + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/azure_entity_resource_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/azure_entity_resource_py3.py new file mode 100644 index 000000000000..d3f80d87498a --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/azure_entity_resource_py3.py @@ -0,0 +1,50 @@ +# 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 .resource_py3 import Resource + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/component.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/component.py new file mode 100644 index 000000000000..814a19a81558 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/component.py @@ -0,0 +1,145 @@ +# 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 Component(ProxyResource): + """Model for component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: For optimistic concurrency control. + :vartype etag: str + :ivar workspace_id: ID of the workspace. + :vartype workspace_id: str + :ivar solution_id: ID of the OMS solution this component belong to. + :vartype solution_id: str + :ivar workload_type: Type of the workload. Possible values include: + 'BaseOS', 'SQL', 'IIS', 'Apache' + :vartype workload_type: str or + ~azure.mgmt.workloadmonitor.models.WorkloadType + :ivar component_name: Name of the component. + :vartype component_name: str + :ivar component_type_id: ID of the component type. + :vartype component_type_id: str + :ivar component_type_name: Name of the component type. Qualifies the type + of component such as whether it is a SQL database, logical disk, website, + etc. + :vartype component_type_name: str + :ivar component_type_group_category: Component type group category. + Classification of component type groups into a logical category. e.g. + Network, Disk, Memory, CPU. + :vartype component_type_group_category: str + :ivar health_state: Health state of the component. Possible values + include: 'Error', 'Warning', 'Success', 'Unknown', 'Uninitialized' + :vartype health_state: str or + ~azure.mgmt.workloadmonitor.models.HealthState + :ivar health_state_category: Category of component's health state. + Possible values include: 'Identity', 'CustomGroup' + :vartype health_state_category: str or + ~azure.mgmt.workloadmonitor.models.HealthStateCategory + :ivar health_state_changes_start_time: Start time for health state + changes. + :vartype health_state_changes_start_time: datetime + :ivar health_state_changes_end_time: End time for health state changes. + :vartype health_state_changes_end_time: datetime + :ivar last_health_state_change_time: Time of last health state change. + :vartype last_health_state_change_time: datetime + :ivar vm_id: ID of the VM this component belongs to. + :vartype vm_id: str + :ivar vm_name: Name of the VM this component belongs to. + :vartype vm_name: str + :ivar vm_tags: Tags on the VM this component belongs to. + :vartype vm_tags: dict[str, str] + :ivar aggregate_properties: Properties requested in aggregation queries. + :vartype aggregate_properties: dict[str, str] + :ivar children: component children. + :vartype children: list[~azure.mgmt.workloadmonitor.models.Component] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'workspace_id': {'readonly': True}, + 'solution_id': {'readonly': True}, + 'workload_type': {'readonly': True}, + 'component_name': {'readonly': True}, + 'component_type_id': {'readonly': True}, + 'component_type_name': {'readonly': True}, + 'component_type_group_category': {'readonly': True}, + 'health_state': {'readonly': True}, + 'health_state_category': {'readonly': True}, + 'health_state_changes_start_time': {'readonly': True}, + 'health_state_changes_end_time': {'readonly': True}, + 'last_health_state_change_time': {'readonly': True}, + 'vm_id': {'readonly': True}, + 'vm_name': {'readonly': True}, + 'vm_tags': {'readonly': True}, + 'aggregate_properties': {'readonly': True}, + 'children': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, + 'solution_id': {'key': 'properties.solutionId', 'type': 'str'}, + 'workload_type': {'key': 'properties.workloadType', 'type': 'str'}, + 'component_name': {'key': 'properties.componentName', 'type': 'str'}, + 'component_type_id': {'key': 'properties.componentTypeId', 'type': 'str'}, + 'component_type_name': {'key': 'properties.componentTypeName', 'type': 'str'}, + 'component_type_group_category': {'key': 'properties.componentTypeGroupCategory', 'type': 'str'}, + 'health_state': {'key': 'properties.healthState', 'type': 'HealthState'}, + 'health_state_category': {'key': 'properties.healthStateCategory', 'type': 'str'}, + 'health_state_changes_start_time': {'key': 'properties.healthStateChangesStartTime', 'type': 'iso-8601'}, + 'health_state_changes_end_time': {'key': 'properties.healthStateChangesEndTime', 'type': 'iso-8601'}, + 'last_health_state_change_time': {'key': 'properties.lastHealthStateChangeTime', 'type': 'iso-8601'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'vm_name': {'key': 'properties.vmName', 'type': 'str'}, + 'vm_tags': {'key': 'properties.vmTags', 'type': '{str}'}, + 'aggregate_properties': {'key': 'properties.aggregateProperties', 'type': '{str}'}, + 'children': {'key': 'properties.children', 'type': '[Component]'}, + } + + def __init__(self, **kwargs): + super(Component, self).__init__(**kwargs) + self.etag = None + self.workspace_id = None + self.solution_id = None + self.workload_type = None + self.component_name = None + self.component_type_id = None + self.component_type_name = None + self.component_type_group_category = None + self.health_state = None + self.health_state_category = None + self.health_state_changes_start_time = None + self.health_state_changes_end_time = None + self.last_health_state_change_time = None + self.vm_id = None + self.vm_name = None + self.vm_tags = None + self.aggregate_properties = None + self.children = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/component_paged.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/component_paged.py new file mode 100644 index 000000000000..b442da3eff96 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/component_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class ComponentPaged(Paged): + """ + A paging container for iterating over a list of :class:`Component ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Component]'} + } + + def __init__(self, *args, **kwargs): + + super(ComponentPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/component_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/component_py3.py new file mode 100644 index 000000000000..fd03fcf7fa07 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/component_py3.py @@ -0,0 +1,145 @@ +# 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_py3 import ProxyResource + + +class Component(ProxyResource): + """Model for component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: For optimistic concurrency control. + :vartype etag: str + :ivar workspace_id: ID of the workspace. + :vartype workspace_id: str + :ivar solution_id: ID of the OMS solution this component belong to. + :vartype solution_id: str + :ivar workload_type: Type of the workload. Possible values include: + 'BaseOS', 'SQL', 'IIS', 'Apache' + :vartype workload_type: str or + ~azure.mgmt.workloadmonitor.models.WorkloadType + :ivar component_name: Name of the component. + :vartype component_name: str + :ivar component_type_id: ID of the component type. + :vartype component_type_id: str + :ivar component_type_name: Name of the component type. Qualifies the type + of component such as whether it is a SQL database, logical disk, website, + etc. + :vartype component_type_name: str + :ivar component_type_group_category: Component type group category. + Classification of component type groups into a logical category. e.g. + Network, Disk, Memory, CPU. + :vartype component_type_group_category: str + :ivar health_state: Health state of the component. Possible values + include: 'Error', 'Warning', 'Success', 'Unknown', 'Uninitialized' + :vartype health_state: str or + ~azure.mgmt.workloadmonitor.models.HealthState + :ivar health_state_category: Category of component's health state. + Possible values include: 'Identity', 'CustomGroup' + :vartype health_state_category: str or + ~azure.mgmt.workloadmonitor.models.HealthStateCategory + :ivar health_state_changes_start_time: Start time for health state + changes. + :vartype health_state_changes_start_time: datetime + :ivar health_state_changes_end_time: End time for health state changes. + :vartype health_state_changes_end_time: datetime + :ivar last_health_state_change_time: Time of last health state change. + :vartype last_health_state_change_time: datetime + :ivar vm_id: ID of the VM this component belongs to. + :vartype vm_id: str + :ivar vm_name: Name of the VM this component belongs to. + :vartype vm_name: str + :ivar vm_tags: Tags on the VM this component belongs to. + :vartype vm_tags: dict[str, str] + :ivar aggregate_properties: Properties requested in aggregation queries. + :vartype aggregate_properties: dict[str, str] + :ivar children: component children. + :vartype children: list[~azure.mgmt.workloadmonitor.models.Component] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'workspace_id': {'readonly': True}, + 'solution_id': {'readonly': True}, + 'workload_type': {'readonly': True}, + 'component_name': {'readonly': True}, + 'component_type_id': {'readonly': True}, + 'component_type_name': {'readonly': True}, + 'component_type_group_category': {'readonly': True}, + 'health_state': {'readonly': True}, + 'health_state_category': {'readonly': True}, + 'health_state_changes_start_time': {'readonly': True}, + 'health_state_changes_end_time': {'readonly': True}, + 'last_health_state_change_time': {'readonly': True}, + 'vm_id': {'readonly': True}, + 'vm_name': {'readonly': True}, + 'vm_tags': {'readonly': True}, + 'aggregate_properties': {'readonly': True}, + 'children': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, + 'solution_id': {'key': 'properties.solutionId', 'type': 'str'}, + 'workload_type': {'key': 'properties.workloadType', 'type': 'str'}, + 'component_name': {'key': 'properties.componentName', 'type': 'str'}, + 'component_type_id': {'key': 'properties.componentTypeId', 'type': 'str'}, + 'component_type_name': {'key': 'properties.componentTypeName', 'type': 'str'}, + 'component_type_group_category': {'key': 'properties.componentTypeGroupCategory', 'type': 'str'}, + 'health_state': {'key': 'properties.healthState', 'type': 'HealthState'}, + 'health_state_category': {'key': 'properties.healthStateCategory', 'type': 'str'}, + 'health_state_changes_start_time': {'key': 'properties.healthStateChangesStartTime', 'type': 'iso-8601'}, + 'health_state_changes_end_time': {'key': 'properties.healthStateChangesEndTime', 'type': 'iso-8601'}, + 'last_health_state_change_time': {'key': 'properties.lastHealthStateChangeTime', 'type': 'iso-8601'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'vm_name': {'key': 'properties.vmName', 'type': 'str'}, + 'vm_tags': {'key': 'properties.vmTags', 'type': '{str}'}, + 'aggregate_properties': {'key': 'properties.aggregateProperties', 'type': '{str}'}, + 'children': {'key': 'properties.children', 'type': '[Component]'}, + } + + def __init__(self, **kwargs) -> None: + super(Component, self).__init__(**kwargs) + self.etag = None + self.workspace_id = None + self.solution_id = None + self.workload_type = None + self.component_name = None + self.component_type_id = None + self.component_type_name = None + self.component_type_group_category = None + self.health_state = None + self.health_state_category = None + self.health_state_changes_start_time = None + self.health_state_changes_end_time = None + self.last_health_state_change_time = None + self.vm_id = None + self.vm_name = None + self.vm_tags = None + self.aggregate_properties = None + self.children = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/error_field_contract.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/error_field_contract.py new file mode 100644 index 000000000000..51e2aee1470f --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/error_field_contract.py @@ -0,0 +1,36 @@ +# 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 ErrorFieldContract(Model): + """Error field contract. + + :param code: Property level error code. + :type code: str + :param message: Human-readable representation of property-level error. + :type message: str + :param target: Property name. + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorFieldContract, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/error_field_contract_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/error_field_contract_py3.py new file mode 100644 index 000000000000..778dacd40ea9 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/error_field_contract_py3.py @@ -0,0 +1,36 @@ +# 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 ErrorFieldContract(Model): + """Error field contract. + + :param code: Property level error code. + :type code: str + :param message: Human-readable representation of property-level error. + :type message: str + :param target: Property name. + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, **kwargs) -> None: + super(ErrorFieldContract, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/error_response.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/error_response.py new file mode 100644 index 000000000000..a16e692b1d3f --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/error_response.py @@ -0,0 +1,51 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error body contract. + + :param code: Service-defined error code. This code serves as a sub-status + for the HTTP error code specified in the response. + :type code: str + :param message: Human-readable representation of the error. + :type message: str + :param details: The list of invalid fields send in request, in case of + validation error. + :type details: list[~azure.mgmt.workloadmonitor.models.ErrorFieldContract] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/error_response_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/error_response_py3.py new file mode 100644 index 000000000000..6b261e5bfa31 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/error_response_py3.py @@ -0,0 +1,51 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error body contract. + + :param code: Service-defined error code. This code serves as a sub-status + for the HTTP error code specified in the response. + :type code: str + :param message: Human-readable representation of the error. + :type message: str + :param details: The list of invalid fields send in request, in case of + validation error. + :type details: list[~azure.mgmt.workloadmonitor.models.ErrorFieldContract] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, + } + + def __init__(self, *, code: str=None, message: str=None, details=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/health_state_change.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/health_state_change.py new file mode 100644 index 000000000000..6916db8bb130 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/health_state_change.py @@ -0,0 +1,43 @@ +# 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 HealthStateChange(Model): + """Model for health state change. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar health_state: Health state of monitor instance. Possible values + include: 'Error', 'Warning', 'Success', 'Unknown', 'Uninitialized' + :vartype health_state: str or + ~azure.mgmt.workloadmonitor.models.HealthState + :ivar health_state_change_time: Time at which this Health state was + reached. + :vartype health_state_change_time: datetime + """ + + _validation = { + 'health_state': {'readonly': True}, + 'health_state_change_time': {'readonly': True}, + } + + _attribute_map = { + 'health_state': {'key': 'healthState', 'type': 'HealthState'}, + 'health_state_change_time': {'key': 'healthStateChangeTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(HealthStateChange, self).__init__(**kwargs) + self.health_state = None + self.health_state_change_time = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/health_state_change_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/health_state_change_py3.py new file mode 100644 index 000000000000..799280af62c6 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/health_state_change_py3.py @@ -0,0 +1,43 @@ +# 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 HealthStateChange(Model): + """Model for health state change. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar health_state: Health state of monitor instance. Possible values + include: 'Error', 'Warning', 'Success', 'Unknown', 'Uninitialized' + :vartype health_state: str or + ~azure.mgmt.workloadmonitor.models.HealthState + :ivar health_state_change_time: Time at which this Health state was + reached. + :vartype health_state_change_time: datetime + """ + + _validation = { + 'health_state': {'readonly': True}, + 'health_state_change_time': {'readonly': True}, + } + + _attribute_map = { + 'health_state': {'key': 'healthState', 'type': 'HealthState'}, + 'health_state_change_time': {'key': 'healthStateChangeTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(HealthStateChange, self).__init__(**kwargs) + self.health_state = None + self.health_state_change_time = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor.py new file mode 100644 index 000000000000..d56f05958a26 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor.py @@ -0,0 +1,159 @@ +# 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 Monitor(ProxyResource): + """Model for Monitor. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: For optimistic concurrency control. + :vartype etag: str + :ivar description: Description of the monitor + :vartype description: str + :ivar monitor_id: ID of the monitor + :vartype monitor_id: str + :ivar monitor_name: Name of the monitor + :vartype monitor_name: str + :ivar monitor_display_name: User friendly display name of the monitor + :vartype monitor_display_name: str + :ivar parent_monitor_name: Name of the parent monitor + :vartype parent_monitor_name: str + :ivar parent_monitor_display_name: User friendly display name of the + parent monitor + :vartype parent_monitor_display_name: str + :ivar monitor_type: Type of the monitor. Possible values include: + 'Aggregate', 'Dependency', 'Unit' + :vartype monitor_type: str or + ~azure.mgmt.workloadmonitor.models.MonitorType + :ivar monitor_category: Category of the monitor. Possible values include: + 'AvailabilityHealth', 'Configuration', 'EntityHealth', + 'PerformanceHealth', 'Security' + :vartype monitor_category: str or + ~azure.mgmt.workloadmonitor.models.MonitorCategory + :ivar component_type_id: Component Type Id of monitor + :vartype component_type_id: str + :ivar component_type_name: Component Type Name of monitor + :vartype component_type_name: str + :ivar component_type_display_name: Component Type Display Name of the + monitor + :vartype component_type_display_name: str + :ivar monitor_state: Is the monitor state enabled or disabled. Possible + values include: 'Enabled', 'Disabled' + :vartype monitor_state: str or + ~azure.mgmt.workloadmonitor.models.MonitorState + :ivar criteria: Collection of MonitorCriteria. For PATCH calls, instead of + partial list, complete list of expected criteria should be passed for + proper updating. + :vartype criteria: + list[~azure.mgmt.workloadmonitor.models.MonitorCriteria] + :ivar alert_generation: Generates alerts or not. Possible values include: + 'Enabled', 'Disabled' + :vartype alert_generation: str or + ~azure.mgmt.workloadmonitor.models.AlertGeneration + :ivar frequency: Frequency at which monitor condition is evaluated + :vartype frequency: int + :ivar lookback_duration: The duration in minutes in the past during which + the monitor is evaluated + :vartype lookback_duration: int + :ivar documentation_url: URL pointing to the documentation of the monitor + :vartype documentation_url: str + :ivar signal_name: Name of the signal on which this monitor is configured. + :vartype signal_name: str + :ivar signal_type: Type of the signal on which this monitor is configured. + :vartype signal_type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'description': {'readonly': True}, + 'monitor_id': {'readonly': True}, + 'monitor_name': {'readonly': True}, + 'monitor_display_name': {'readonly': True}, + 'parent_monitor_name': {'readonly': True}, + 'parent_monitor_display_name': {'readonly': True}, + 'monitor_type': {'readonly': True}, + 'monitor_category': {'readonly': True}, + 'component_type_id': {'readonly': True}, + 'component_type_name': {'readonly': True}, + 'component_type_display_name': {'readonly': True}, + 'monitor_state': {'readonly': True}, + 'criteria': {'readonly': True}, + 'alert_generation': {'readonly': True}, + 'frequency': {'readonly': True}, + 'lookback_duration': {'readonly': True}, + 'documentation_url': {'readonly': True}, + 'signal_name': {'readonly': True}, + 'signal_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'monitor_id': {'key': 'properties.monitorId', 'type': 'str'}, + 'monitor_name': {'key': 'properties.monitorName', 'type': 'str'}, + 'monitor_display_name': {'key': 'properties.monitorDisplayName', 'type': 'str'}, + 'parent_monitor_name': {'key': 'properties.parentMonitorName', 'type': 'str'}, + 'parent_monitor_display_name': {'key': 'properties.parentMonitorDisplayName', 'type': 'str'}, + 'monitor_type': {'key': 'properties.monitorType', 'type': 'MonitorType'}, + 'monitor_category': {'key': 'properties.monitorCategory', 'type': 'MonitorCategory'}, + 'component_type_id': {'key': 'properties.componentTypeId', 'type': 'str'}, + 'component_type_name': {'key': 'properties.componentTypeName', 'type': 'str'}, + 'component_type_display_name': {'key': 'properties.componentTypeDisplayName', 'type': 'str'}, + 'monitor_state': {'key': 'properties.monitorState', 'type': 'MonitorState'}, + 'criteria': {'key': 'properties.criteria', 'type': '[MonitorCriteria]'}, + 'alert_generation': {'key': 'properties.alertGeneration', 'type': 'str'}, + 'frequency': {'key': 'properties.frequency', 'type': 'int'}, + 'lookback_duration': {'key': 'properties.lookbackDuration', 'type': 'int'}, + 'documentation_url': {'key': 'properties.documentationURL', 'type': 'str'}, + 'signal_name': {'key': 'properties.signalName', 'type': 'str'}, + 'signal_type': {'key': 'properties.signalType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Monitor, self).__init__(**kwargs) + self.etag = None + self.description = None + self.monitor_id = None + self.monitor_name = None + self.monitor_display_name = None + self.parent_monitor_name = None + self.parent_monitor_display_name = None + self.monitor_type = None + self.monitor_category = None + self.component_type_id = None + self.component_type_name = None + self.component_type_display_name = None + self.monitor_state = None + self.criteria = None + self.alert_generation = None + self.frequency = None + self.lookback_duration = None + self.documentation_url = None + self.signal_name = None + self.signal_type = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_criteria.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_criteria.py new file mode 100644 index 000000000000..7f9f73af57ca --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_criteria.py @@ -0,0 +1,50 @@ +# 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 MonitorCriteria(Model): + """Criteria for monitor configuration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar health_state: Target health state of the criteria. Possible values + include: 'Error', 'Warning', 'Success', 'Unknown', 'Uninitialized' + :vartype health_state: str or + ~azure.mgmt.workloadmonitor.models.HealthState + :ivar threshold: Threshold value for this criteria + :vartype threshold: float + :ivar comparison_operator: Comparison enum on threshold of this criteria. + Possible values include: 'Equals', 'GreaterThan', 'GreaterThanOrEqual', + 'LessThan', 'LessThanOrEqual', 'NotEquals' + :vartype comparison_operator: str or + ~azure.mgmt.workloadmonitor.models.Operator + """ + + _validation = { + 'health_state': {'readonly': True}, + 'threshold': {'readonly': True}, + 'comparison_operator': {'readonly': True}, + } + + _attribute_map = { + 'health_state': {'key': 'healthState', 'type': 'HealthState'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + 'comparison_operator': {'key': 'comparisonOperator', 'type': 'Operator'}, + } + + def __init__(self, **kwargs): + super(MonitorCriteria, self).__init__(**kwargs) + self.health_state = None + self.threshold = None + self.comparison_operator = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_criteria_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_criteria_py3.py new file mode 100644 index 000000000000..ca5b69e5c809 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_criteria_py3.py @@ -0,0 +1,50 @@ +# 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 MonitorCriteria(Model): + """Criteria for monitor configuration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar health_state: Target health state of the criteria. Possible values + include: 'Error', 'Warning', 'Success', 'Unknown', 'Uninitialized' + :vartype health_state: str or + ~azure.mgmt.workloadmonitor.models.HealthState + :ivar threshold: Threshold value for this criteria + :vartype threshold: float + :ivar comparison_operator: Comparison enum on threshold of this criteria. + Possible values include: 'Equals', 'GreaterThan', 'GreaterThanOrEqual', + 'LessThan', 'LessThanOrEqual', 'NotEquals' + :vartype comparison_operator: str or + ~azure.mgmt.workloadmonitor.models.Operator + """ + + _validation = { + 'health_state': {'readonly': True}, + 'threshold': {'readonly': True}, + 'comparison_operator': {'readonly': True}, + } + + _attribute_map = { + 'health_state': {'key': 'healthState', 'type': 'HealthState'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + 'comparison_operator': {'key': 'comparisonOperator', 'type': 'Operator'}, + } + + def __init__(self, **kwargs) -> None: + super(MonitorCriteria, self).__init__(**kwargs) + self.health_state = None + self.threshold = None + self.comparison_operator = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_instance.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_instance.py new file mode 100644 index 000000000000..5dba4723285c --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_instance.py @@ -0,0 +1,170 @@ +# 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 MonitorInstance(ProxyResource): + """Model for monitor instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: For optimistic concurrency control. + :vartype etag: str + :ivar workspace_id: ID of the workspace. + :vartype workspace_id: str + :ivar solution_id: ID of the OMS solution this health instance belong to. + :vartype solution_id: str + :ivar workload_type: Type of the workload. Possible values include: + 'BaseOS', 'SQL', 'IIS', 'Apache' + :vartype workload_type: str or + ~azure.mgmt.workloadmonitor.models.WorkloadType + :ivar component_id: ID of the component. + :vartype component_id: str + :ivar component_name: Name of the component. + :vartype component_name: str + :ivar component_type_id: ID of the component type. + :vartype component_type_id: str + :ivar component_type_name: Name of the component type. Qualifies the type + of component such as whether it is a SQL database, logical disk, website, + etc. + :vartype component_type_name: str + :ivar monitor_id: ID of the monitor instance. + :vartype monitor_id: str + :ivar monitor_name: Name of the monitor. + :vartype monitor_name: str + :ivar monitor_type: Type of the monitor. The qualifier for the health + criteria depending on the functionality it performs such as Unit, + Aggregate, Dependency. Possible values include: 'Aggregate', 'Dependency', + 'Unit' + :vartype monitor_type: str or + ~azure.mgmt.workloadmonitor.models.MonitorType + :ivar monitor_category: Monitor type category. Indicates the attribute of + the component that the health criteria monitors such as Performance, + Availability, etc. Possible values include: 'AvailabilityHealth', + 'Configuration', 'EntityHealth', 'PerformanceHealth', 'Security' + :vartype monitor_category: str or + ~azure.mgmt.workloadmonitor.models.MonitorCategory + :ivar health_state: Health state of monitor instance. Possible values + include: 'Error', 'Warning', 'Success', 'Unknown', 'Uninitialized' + :vartype health_state: str or + ~azure.mgmt.workloadmonitor.models.HealthState + :ivar health_state_category: Category of monitor instance's health state. + Possible values include: 'Identity', 'CustomGroup' + :vartype health_state_category: str or + ~azure.mgmt.workloadmonitor.models.HealthStateCategory + :ivar health_state_changes: Health state changes. + :vartype health_state_changes: + list[~azure.mgmt.workloadmonitor.models.HealthStateChange] + :ivar health_state_changes_start_time: Start time for health state + changes. + :vartype health_state_changes_start_time: datetime + :ivar health_state_changes_end_time: End time for health state changes. + :vartype health_state_changes_end_time: datetime + :ivar last_health_state_change_time: Time of last health state change. + :vartype last_health_state_change_time: datetime + :ivar alert_generation: Generates alert or not. Possible values include: + 'Enabled', 'Disabled' + :vartype alert_generation: str or + ~azure.mgmt.workloadmonitor.models.AlertGeneration + :ivar aggregate_properties: Properties requested in aggregation queries. + :vartype aggregate_properties: dict[str, str] + :ivar children: Health instance children. + :vartype children: + list[~azure.mgmt.workloadmonitor.models.MonitorInstance] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'workspace_id': {'readonly': True}, + 'solution_id': {'readonly': True}, + 'workload_type': {'readonly': True}, + 'component_id': {'readonly': True}, + 'component_name': {'readonly': True}, + 'component_type_id': {'readonly': True}, + 'component_type_name': {'readonly': True}, + 'monitor_id': {'readonly': True}, + 'monitor_name': {'readonly': True}, + 'monitor_type': {'readonly': True}, + 'monitor_category': {'readonly': True}, + 'health_state': {'readonly': True}, + 'health_state_category': {'readonly': True}, + 'health_state_changes': {'readonly': True}, + 'health_state_changes_start_time': {'readonly': True}, + 'health_state_changes_end_time': {'readonly': True}, + 'last_health_state_change_time': {'readonly': True}, + 'alert_generation': {'readonly': True}, + 'aggregate_properties': {'readonly': True}, + 'children': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, + 'solution_id': {'key': 'properties.solutionId', 'type': 'str'}, + 'workload_type': {'key': 'properties.workloadType', 'type': 'str'}, + 'component_id': {'key': 'properties.componentId', 'type': 'str'}, + 'component_name': {'key': 'properties.componentName', 'type': 'str'}, + 'component_type_id': {'key': 'properties.componentTypeId', 'type': 'str'}, + 'component_type_name': {'key': 'properties.componentTypeName', 'type': 'str'}, + 'monitor_id': {'key': 'properties.monitorId', 'type': 'str'}, + 'monitor_name': {'key': 'properties.monitorName', 'type': 'str'}, + 'monitor_type': {'key': 'properties.monitorType', 'type': 'MonitorType'}, + 'monitor_category': {'key': 'properties.monitorCategory', 'type': 'MonitorCategory'}, + 'health_state': {'key': 'properties.healthState', 'type': 'HealthState'}, + 'health_state_category': {'key': 'properties.healthStateCategory', 'type': 'str'}, + 'health_state_changes': {'key': 'properties.healthStateChanges', 'type': '[HealthStateChange]'}, + 'health_state_changes_start_time': {'key': 'properties.healthStateChangesStartTime', 'type': 'iso-8601'}, + 'health_state_changes_end_time': {'key': 'properties.healthStateChangesEndTime', 'type': 'iso-8601'}, + 'last_health_state_change_time': {'key': 'properties.lastHealthStateChangeTime', 'type': 'iso-8601'}, + 'alert_generation': {'key': 'properties.alertGeneration', 'type': 'str'}, + 'aggregate_properties': {'key': 'properties.aggregateProperties', 'type': '{str}'}, + 'children': {'key': 'properties.children', 'type': '[MonitorInstance]'}, + } + + def __init__(self, **kwargs): + super(MonitorInstance, self).__init__(**kwargs) + self.etag = None + self.workspace_id = None + self.solution_id = None + self.workload_type = None + self.component_id = None + self.component_name = None + self.component_type_id = None + self.component_type_name = None + self.monitor_id = None + self.monitor_name = None + self.monitor_type = None + self.monitor_category = None + self.health_state = None + self.health_state_category = None + self.health_state_changes = None + self.health_state_changes_start_time = None + self.health_state_changes_end_time = None + self.last_health_state_change_time = None + self.alert_generation = None + self.aggregate_properties = None + self.children = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_instance_paged.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_instance_paged.py new file mode 100644 index 000000000000..7292bedad63e --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_instance_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class MonitorInstancePaged(Paged): + """ + A paging container for iterating over a list of :class:`MonitorInstance ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[MonitorInstance]'} + } + + def __init__(self, *args, **kwargs): + + super(MonitorInstancePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_instance_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_instance_py3.py new file mode 100644 index 000000000000..ef5393d98185 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_instance_py3.py @@ -0,0 +1,170 @@ +# 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_py3 import ProxyResource + + +class MonitorInstance(ProxyResource): + """Model for monitor instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: For optimistic concurrency control. + :vartype etag: str + :ivar workspace_id: ID of the workspace. + :vartype workspace_id: str + :ivar solution_id: ID of the OMS solution this health instance belong to. + :vartype solution_id: str + :ivar workload_type: Type of the workload. Possible values include: + 'BaseOS', 'SQL', 'IIS', 'Apache' + :vartype workload_type: str or + ~azure.mgmt.workloadmonitor.models.WorkloadType + :ivar component_id: ID of the component. + :vartype component_id: str + :ivar component_name: Name of the component. + :vartype component_name: str + :ivar component_type_id: ID of the component type. + :vartype component_type_id: str + :ivar component_type_name: Name of the component type. Qualifies the type + of component such as whether it is a SQL database, logical disk, website, + etc. + :vartype component_type_name: str + :ivar monitor_id: ID of the monitor instance. + :vartype monitor_id: str + :ivar monitor_name: Name of the monitor. + :vartype monitor_name: str + :ivar monitor_type: Type of the monitor. The qualifier for the health + criteria depending on the functionality it performs such as Unit, + Aggregate, Dependency. Possible values include: 'Aggregate', 'Dependency', + 'Unit' + :vartype monitor_type: str or + ~azure.mgmt.workloadmonitor.models.MonitorType + :ivar monitor_category: Monitor type category. Indicates the attribute of + the component that the health criteria monitors such as Performance, + Availability, etc. Possible values include: 'AvailabilityHealth', + 'Configuration', 'EntityHealth', 'PerformanceHealth', 'Security' + :vartype monitor_category: str or + ~azure.mgmt.workloadmonitor.models.MonitorCategory + :ivar health_state: Health state of monitor instance. Possible values + include: 'Error', 'Warning', 'Success', 'Unknown', 'Uninitialized' + :vartype health_state: str or + ~azure.mgmt.workloadmonitor.models.HealthState + :ivar health_state_category: Category of monitor instance's health state. + Possible values include: 'Identity', 'CustomGroup' + :vartype health_state_category: str or + ~azure.mgmt.workloadmonitor.models.HealthStateCategory + :ivar health_state_changes: Health state changes. + :vartype health_state_changes: + list[~azure.mgmt.workloadmonitor.models.HealthStateChange] + :ivar health_state_changes_start_time: Start time for health state + changes. + :vartype health_state_changes_start_time: datetime + :ivar health_state_changes_end_time: End time for health state changes. + :vartype health_state_changes_end_time: datetime + :ivar last_health_state_change_time: Time of last health state change. + :vartype last_health_state_change_time: datetime + :ivar alert_generation: Generates alert or not. Possible values include: + 'Enabled', 'Disabled' + :vartype alert_generation: str or + ~azure.mgmt.workloadmonitor.models.AlertGeneration + :ivar aggregate_properties: Properties requested in aggregation queries. + :vartype aggregate_properties: dict[str, str] + :ivar children: Health instance children. + :vartype children: + list[~azure.mgmt.workloadmonitor.models.MonitorInstance] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'workspace_id': {'readonly': True}, + 'solution_id': {'readonly': True}, + 'workload_type': {'readonly': True}, + 'component_id': {'readonly': True}, + 'component_name': {'readonly': True}, + 'component_type_id': {'readonly': True}, + 'component_type_name': {'readonly': True}, + 'monitor_id': {'readonly': True}, + 'monitor_name': {'readonly': True}, + 'monitor_type': {'readonly': True}, + 'monitor_category': {'readonly': True}, + 'health_state': {'readonly': True}, + 'health_state_category': {'readonly': True}, + 'health_state_changes': {'readonly': True}, + 'health_state_changes_start_time': {'readonly': True}, + 'health_state_changes_end_time': {'readonly': True}, + 'last_health_state_change_time': {'readonly': True}, + 'alert_generation': {'readonly': True}, + 'aggregate_properties': {'readonly': True}, + 'children': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, + 'solution_id': {'key': 'properties.solutionId', 'type': 'str'}, + 'workload_type': {'key': 'properties.workloadType', 'type': 'str'}, + 'component_id': {'key': 'properties.componentId', 'type': 'str'}, + 'component_name': {'key': 'properties.componentName', 'type': 'str'}, + 'component_type_id': {'key': 'properties.componentTypeId', 'type': 'str'}, + 'component_type_name': {'key': 'properties.componentTypeName', 'type': 'str'}, + 'monitor_id': {'key': 'properties.monitorId', 'type': 'str'}, + 'monitor_name': {'key': 'properties.monitorName', 'type': 'str'}, + 'monitor_type': {'key': 'properties.monitorType', 'type': 'MonitorType'}, + 'monitor_category': {'key': 'properties.monitorCategory', 'type': 'MonitorCategory'}, + 'health_state': {'key': 'properties.healthState', 'type': 'HealthState'}, + 'health_state_category': {'key': 'properties.healthStateCategory', 'type': 'str'}, + 'health_state_changes': {'key': 'properties.healthStateChanges', 'type': '[HealthStateChange]'}, + 'health_state_changes_start_time': {'key': 'properties.healthStateChangesStartTime', 'type': 'iso-8601'}, + 'health_state_changes_end_time': {'key': 'properties.healthStateChangesEndTime', 'type': 'iso-8601'}, + 'last_health_state_change_time': {'key': 'properties.lastHealthStateChangeTime', 'type': 'iso-8601'}, + 'alert_generation': {'key': 'properties.alertGeneration', 'type': 'str'}, + 'aggregate_properties': {'key': 'properties.aggregateProperties', 'type': '{str}'}, + 'children': {'key': 'properties.children', 'type': '[MonitorInstance]'}, + } + + def __init__(self, **kwargs) -> None: + super(MonitorInstance, self).__init__(**kwargs) + self.etag = None + self.workspace_id = None + self.solution_id = None + self.workload_type = None + self.component_id = None + self.component_name = None + self.component_type_id = None + self.component_type_name = None + self.monitor_id = None + self.monitor_name = None + self.monitor_type = None + self.monitor_category = None + self.health_state = None + self.health_state_category = None + self.health_state_changes = None + self.health_state_changes_start_time = None + self.health_state_changes_end_time = None + self.last_health_state_change_time = None + self.alert_generation = None + self.aggregate_properties = None + self.children = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_paged.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_paged.py new file mode 100644 index 000000000000..ef8155e616ec --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class MonitorPaged(Paged): + """ + A paging container for iterating over a list of :class:`Monitor ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Monitor]'} + } + + def __init__(self, *args, **kwargs): + + super(MonitorPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_py3.py new file mode 100644 index 000000000000..d4761565866f --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/monitor_py3.py @@ -0,0 +1,159 @@ +# 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_py3 import ProxyResource + + +class Monitor(ProxyResource): + """Model for Monitor. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: For optimistic concurrency control. + :vartype etag: str + :ivar description: Description of the monitor + :vartype description: str + :ivar monitor_id: ID of the monitor + :vartype monitor_id: str + :ivar monitor_name: Name of the monitor + :vartype monitor_name: str + :ivar monitor_display_name: User friendly display name of the monitor + :vartype monitor_display_name: str + :ivar parent_monitor_name: Name of the parent monitor + :vartype parent_monitor_name: str + :ivar parent_monitor_display_name: User friendly display name of the + parent monitor + :vartype parent_monitor_display_name: str + :ivar monitor_type: Type of the monitor. Possible values include: + 'Aggregate', 'Dependency', 'Unit' + :vartype monitor_type: str or + ~azure.mgmt.workloadmonitor.models.MonitorType + :ivar monitor_category: Category of the monitor. Possible values include: + 'AvailabilityHealth', 'Configuration', 'EntityHealth', + 'PerformanceHealth', 'Security' + :vartype monitor_category: str or + ~azure.mgmt.workloadmonitor.models.MonitorCategory + :ivar component_type_id: Component Type Id of monitor + :vartype component_type_id: str + :ivar component_type_name: Component Type Name of monitor + :vartype component_type_name: str + :ivar component_type_display_name: Component Type Display Name of the + monitor + :vartype component_type_display_name: str + :ivar monitor_state: Is the monitor state enabled or disabled. Possible + values include: 'Enabled', 'Disabled' + :vartype monitor_state: str or + ~azure.mgmt.workloadmonitor.models.MonitorState + :ivar criteria: Collection of MonitorCriteria. For PATCH calls, instead of + partial list, complete list of expected criteria should be passed for + proper updating. + :vartype criteria: + list[~azure.mgmt.workloadmonitor.models.MonitorCriteria] + :ivar alert_generation: Generates alerts or not. Possible values include: + 'Enabled', 'Disabled' + :vartype alert_generation: str or + ~azure.mgmt.workloadmonitor.models.AlertGeneration + :ivar frequency: Frequency at which monitor condition is evaluated + :vartype frequency: int + :ivar lookback_duration: The duration in minutes in the past during which + the monitor is evaluated + :vartype lookback_duration: int + :ivar documentation_url: URL pointing to the documentation of the monitor + :vartype documentation_url: str + :ivar signal_name: Name of the signal on which this monitor is configured. + :vartype signal_name: str + :ivar signal_type: Type of the signal on which this monitor is configured. + :vartype signal_type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'description': {'readonly': True}, + 'monitor_id': {'readonly': True}, + 'monitor_name': {'readonly': True}, + 'monitor_display_name': {'readonly': True}, + 'parent_monitor_name': {'readonly': True}, + 'parent_monitor_display_name': {'readonly': True}, + 'monitor_type': {'readonly': True}, + 'monitor_category': {'readonly': True}, + 'component_type_id': {'readonly': True}, + 'component_type_name': {'readonly': True}, + 'component_type_display_name': {'readonly': True}, + 'monitor_state': {'readonly': True}, + 'criteria': {'readonly': True}, + 'alert_generation': {'readonly': True}, + 'frequency': {'readonly': True}, + 'lookback_duration': {'readonly': True}, + 'documentation_url': {'readonly': True}, + 'signal_name': {'readonly': True}, + 'signal_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'monitor_id': {'key': 'properties.monitorId', 'type': 'str'}, + 'monitor_name': {'key': 'properties.monitorName', 'type': 'str'}, + 'monitor_display_name': {'key': 'properties.monitorDisplayName', 'type': 'str'}, + 'parent_monitor_name': {'key': 'properties.parentMonitorName', 'type': 'str'}, + 'parent_monitor_display_name': {'key': 'properties.parentMonitorDisplayName', 'type': 'str'}, + 'monitor_type': {'key': 'properties.monitorType', 'type': 'MonitorType'}, + 'monitor_category': {'key': 'properties.monitorCategory', 'type': 'MonitorCategory'}, + 'component_type_id': {'key': 'properties.componentTypeId', 'type': 'str'}, + 'component_type_name': {'key': 'properties.componentTypeName', 'type': 'str'}, + 'component_type_display_name': {'key': 'properties.componentTypeDisplayName', 'type': 'str'}, + 'monitor_state': {'key': 'properties.monitorState', 'type': 'MonitorState'}, + 'criteria': {'key': 'properties.criteria', 'type': '[MonitorCriteria]'}, + 'alert_generation': {'key': 'properties.alertGeneration', 'type': 'str'}, + 'frequency': {'key': 'properties.frequency', 'type': 'int'}, + 'lookback_duration': {'key': 'properties.lookbackDuration', 'type': 'int'}, + 'documentation_url': {'key': 'properties.documentationURL', 'type': 'str'}, + 'signal_name': {'key': 'properties.signalName', 'type': 'str'}, + 'signal_type': {'key': 'properties.signalType', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Monitor, self).__init__(**kwargs) + self.etag = None + self.description = None + self.monitor_id = None + self.monitor_name = None + self.monitor_display_name = None + self.parent_monitor_name = None + self.parent_monitor_display_name = None + self.monitor_type = None + self.monitor_category = None + self.component_type_id = None + self.component_type_name = None + self.component_type_display_name = None + self.monitor_state = None + self.criteria = None + self.alert_generation = None + self.frequency = None + self.lookback_duration = None + self.documentation_url = None + self.signal_name = None + self.signal_type = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting.py new file mode 100644 index 000000000000..22cd1ae5d8bd --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting.py @@ -0,0 +1,55 @@ +# 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 NotificationSetting(ProxyResource): + """Model for NotificationSetting. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: For optimistic concurrency control. + :vartype etag: str + :ivar action_group_resource_ids: List of action group resource ids to be + notified + :vartype action_group_resource_ids: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'action_group_resource_ids': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'action_group_resource_ids': {'key': 'properties.actionGroupResourceIds', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(NotificationSetting, self).__init__(**kwargs) + self.etag = None + self.action_group_resource_ids = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_paged.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_paged.py new file mode 100644 index 000000000000..3a9cfa14ee57 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class NotificationSettingPaged(Paged): + """ + A paging container for iterating over a list of :class:`NotificationSetting ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[NotificationSetting]'} + } + + def __init__(self, *args, **kwargs): + + super(NotificationSettingPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_py3.py new file mode 100644 index 000000000000..7401a2f5799c --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_py3.py @@ -0,0 +1,55 @@ +# 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_py3 import ProxyResource + + +class NotificationSetting(ProxyResource): + """Model for NotificationSetting. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: For optimistic concurrency control. + :vartype etag: str + :ivar action_group_resource_ids: List of action group resource ids to be + notified + :vartype action_group_resource_ids: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'action_group_resource_ids': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'action_group_resource_ids': {'key': 'properties.actionGroupResourceIds', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(NotificationSetting, self).__init__(**kwargs) + self.etag = None + self.action_group_resource_ids = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/operation.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/operation.py new file mode 100644 index 000000000000..08c8f8bd9397 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/operation.py @@ -0,0 +1,45 @@ +# 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 Operation(Model): + """Operation supported by the resource provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar display: The properties of the resource operation. + :vartype display: ~azure.mgmt.workloadmonitor.models.OperationProperties + :ivar name: The name of the resource operation. + :vartype name: str + :ivar origin: The origin of the operation. + :vartype origin: str + """ + + _validation = { + 'display': {'readonly': True}, + 'name': {'readonly': True}, + 'origin': {'readonly': True}, + } + + _attribute_map = { + 'display': {'key': 'display', 'type': 'OperationProperties'}, + 'name': {'key': 'name', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.display = None + self.name = None + self.origin = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/operation_paged.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/operation_paged.py new file mode 100644 index 000000000000..451cfe4cc593 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/operation_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/operation_properties.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/operation_properties.py new file mode 100644 index 000000000000..395e713c65d0 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/operation_properties.py @@ -0,0 +1,50 @@ +# 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 OperationProperties(Model): + """Properties of an operation supported by the resource provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar description: The description of the resource provider. + :vartype description: str + :ivar operation: This operation name. + :vartype operation: str + :ivar provider: The provider name. + :vartype provider: str + :ivar resource: The resource name. + :vartype resource: str + """ + + _validation = { + 'description': {'readonly': True}, + 'operation': {'readonly': True}, + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationProperties, self).__init__(**kwargs) + self.description = None + self.operation = None + self.provider = None + self.resource = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/operation_properties_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/operation_properties_py3.py new file mode 100644 index 000000000000..f904845650ff --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/operation_properties_py3.py @@ -0,0 +1,50 @@ +# 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 OperationProperties(Model): + """Properties of an operation supported by the resource provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar description: The description of the resource provider. + :vartype description: str + :ivar operation: This operation name. + :vartype operation: str + :ivar provider: The provider name. + :vartype provider: str + :ivar resource: The resource name. + :vartype resource: str + """ + + _validation = { + 'description': {'readonly': True}, + 'operation': {'readonly': True}, + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationProperties, self).__init__(**kwargs) + self.description = None + self.operation = None + self.provider = None + self.resource = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/operation_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/operation_py3.py new file mode 100644 index 000000000000..f58d6f42b9c4 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/operation_py3.py @@ -0,0 +1,45 @@ +# 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 Operation(Model): + """Operation supported by the resource provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar display: The properties of the resource operation. + :vartype display: ~azure.mgmt.workloadmonitor.models.OperationProperties + :ivar name: The name of the resource operation. + :vartype name: str + :ivar origin: The origin of the operation. + :vartype origin: str + """ + + _validation = { + 'display': {'readonly': True}, + 'name': {'readonly': True}, + 'origin': {'readonly': True}, + } + + _attribute_map = { + 'display': {'key': 'display', 'type': 'OperationProperties'}, + 'name': {'key': 'name', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.display = None + self.name = None + self.origin = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/proxy_resource.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/proxy_resource.py new file mode 100644 index 000000000000..0de8fb6bd420 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/proxy_resource.py @@ -0,0 +1,45 @@ +# 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 .resource import Resource + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/proxy_resource_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/proxy_resource_py3.py new file mode 100644 index 000000000000..2e8391f912d6 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/proxy_resource_py3.py @@ -0,0 +1,45 @@ +# 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 .resource_py3 import Resource + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/resource.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/resource.py new file mode 100644 index 000000000000..9333a2ac49ef --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/resource.py @@ -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 msrest.serialization import Model + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/resource_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/resource_py3.py new file mode 100644 index 000000000000..370e6c506581 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/resource_py3.py @@ -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 msrest.serialization import Model + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/tracked_resource.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/tracked_resource.py new file mode 100644 index 000000000000..27ab94c7a8dd --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/tracked_resource.py @@ -0,0 +1,55 @@ +# 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 .resource import Resource + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/tracked_resource_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/tracked_resource_py3.py new file mode 100644 index 000000000000..b28cc1859448 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/tracked_resource_py3.py @@ -0,0 +1,55 @@ +# 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 .resource_py3 import Resource + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/workload_monitor_api_enums.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/workload_monitor_api_enums.py new file mode 100644 index 000000000000..deeee9993f79 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/workload_monitor_api_enums.py @@ -0,0 +1,73 @@ +# 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 enum import Enum + + +class MonitorType(str, Enum): + + aggregate = "Aggregate" + dependency = "Dependency" + unit = "Unit" + + +class MonitorCategory(str, Enum): + + availability_health = "AvailabilityHealth" + configuration = "Configuration" + entity_health = "EntityHealth" + performance_health = "PerformanceHealth" + security = "Security" + + +class MonitorState(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class HealthState(str, Enum): + + error = "Error" + warning = "Warning" + success = "Success" + unknown = "Unknown" + uninitialized = "Uninitialized" + + +class Operator(str, Enum): + + equals = "Equals" + greater_than = "GreaterThan" + greater_than_or_equal = "GreaterThanOrEqual" + less_than = "LessThan" + less_than_or_equal = "LessThanOrEqual" + not_equals = "NotEquals" + + +class AlertGeneration(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class WorkloadType(str, Enum): + + base_os = "BaseOS" + sql = "SQL" + iis = "IIS" + apache = "Apache" + + +class HealthStateCategory(str, Enum): + + identity = "Identity" + custom_group = "CustomGroup" diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/__init__.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/__init__.py new file mode 100644 index 000000000000..0134ac62c62d --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/__init__.py @@ -0,0 +1,28 @@ +# 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 .monitors_operations import MonitorsOperations +from .components_operations import ComponentsOperations +from .monitor_instances_operations import MonitorInstancesOperations +from .notification_settings_operations import NotificationSettingsOperations +from .components_summary_operations import ComponentsSummaryOperations +from .monitor_instances_summary_operations import MonitorInstancesSummaryOperations +from .operations import Operations + +__all__ = [ + 'MonitorsOperations', + 'ComponentsOperations', + 'MonitorInstancesOperations', + 'NotificationSettingsOperations', + 'ComponentsSummaryOperations', + 'MonitorInstancesSummaryOperations', + 'Operations', +] diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/components_operations.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/components_operations.py new file mode 100644 index 000000000000..e4afb8c3ab46 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/components_operations.py @@ -0,0 +1,221 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ComponentsOperations(object): + """ComponentsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-08-31-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-31-preview" + + self.config = config + + def list_by_resource( + self, resource_group_name, resource_namespace, resource_type, resource_name, select=None, filter=None, apply=None, orderby=None, expand=None, top=None, skiptoken=None, custom_headers=None, raw=False, **operation_config): + """Get list of components for a resource. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :param select: Properties to be returned in the response. + :type select: str + :param filter: Filter to be applied on the operation. + :type filter: str + :param apply: Apply aggregation. + :type apply: str + :param orderby: Sort the result on one or more properties. + :type orderby: str + :param expand: Include properties inline in the response. + :type expand: str + :param top: Limit the result to the specified number of rows. + :type top: str + :param skiptoken: The page-continuation token to use with a paged + version of this API. + :type skiptoken: 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`. + :return: An iterator like instance of Component + :rtype: + ~azure.mgmt.workloadmonitor.models.ComponentPaged[~azure.mgmt.workloadmonitor.models.Component] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + + else: + url = next_link + query_parameters = {} + + # 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) + + return response + + # Deserialize response + deserialized = models.ComponentPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ComponentPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/components'} + + def get( + self, resource_group_name, resource_namespace, resource_type, resource_name, component_id, select=None, expand=None, custom_headers=None, raw=False, **operation_config): + """Get details of a component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :param component_id: Component Id. + :type component_id: str + :param select: Properties to be returned in the response. + :type select: str + :param expand: Include properties inline in the response. + :type expand: 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`. + :return: Component or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.workloadmonitor.models.Component or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'componentId': self._serialize.url("component_id", component_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, '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('Component', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/components/{componentId}'} diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/components_summary_operations.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/components_summary_operations.py new file mode 100644 index 000000000000..c96ec7c5016f --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/components_summary_operations.py @@ -0,0 +1,129 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ComponentsSummaryOperations(object): + """ComponentsSummaryOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-08-31-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-31-preview" + + self.config = config + + def list( + self, select=None, filter=None, apply=None, orderby=None, expand=None, top=None, skiptoken=None, custom_headers=None, raw=False, **operation_config): + """Get subscription wide details of components. + + :param select: Properties to be returned in the response. + :type select: str + :param filter: Filter to be applied on the operation. + :type filter: str + :param apply: Apply aggregation. + :type apply: str + :param orderby: Sort the result on one or more properties. + :type orderby: str + :param expand: Include properties inline in the response. + :type expand: str + :param top: Limit the result to the specified number of rows. + :type top: str + :param skiptoken: The page-continuation token to use with a paged + version of this API. + :type skiptoken: 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`. + :return: An iterator like instance of Component + :rtype: + ~azure.mgmt.workloadmonitor.models.ComponentPaged[~azure.mgmt.workloadmonitor.models.Component] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + + else: + url = next_link + query_parameters = {} + + # 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) + + return response + + # Deserialize response + deserialized = models.ComponentPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ComponentPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.WorkloadMonitor/componentsSummary'} diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/monitor_instances_operations.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/monitor_instances_operations.py new file mode 100644 index 000000000000..f869efe6c172 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/monitor_instances_operations.py @@ -0,0 +1,221 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class MonitorInstancesOperations(object): + """MonitorInstancesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-08-31-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-31-preview" + + self.config = config + + def list_by_resource( + self, resource_group_name, resource_namespace, resource_type, resource_name, select=None, filter=None, apply=None, orderby=None, expand=None, top=None, skiptoken=None, custom_headers=None, raw=False, **operation_config): + """Get list of monitor instances for a resource. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :param select: Properties to be returned in the response. + :type select: str + :param filter: Filter to be applied on the operation. + :type filter: str + :param apply: Apply aggregation. + :type apply: str + :param orderby: Sort the result on one or more properties. + :type orderby: str + :param expand: Include properties inline in the response. + :type expand: str + :param top: Limit the result to the specified number of rows. + :type top: str + :param skiptoken: The page-continuation token to use with a paged + version of this API. + :type skiptoken: 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`. + :return: An iterator like instance of MonitorInstance + :rtype: + ~azure.mgmt.workloadmonitor.models.MonitorInstancePaged[~azure.mgmt.workloadmonitor.models.MonitorInstance] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + + else: + url = next_link + query_parameters = {} + + # 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) + + return response + + # Deserialize response + deserialized = models.MonitorInstancePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MonitorInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/monitorInstances'} + + def get( + self, resource_group_name, resource_namespace, resource_type, resource_name, monitor_instance_id, select=None, expand=None, custom_headers=None, raw=False, **operation_config): + """Get details of a monitorInstance. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :param monitor_instance_id: MonitorInstance Id. + :type monitor_instance_id: str + :param select: Properties to be returned in the response. + :type select: str + :param expand: Include properties inline in the response. + :type expand: 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`. + :return: MonitorInstance or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.workloadmonitor.models.MonitorInstance or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'monitorInstanceId': self._serialize.url("monitor_instance_id", monitor_instance_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, '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('MonitorInstance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/monitorInstances/{monitorInstanceId}'} diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/monitor_instances_summary_operations.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/monitor_instances_summary_operations.py new file mode 100644 index 000000000000..ec027a6c8f01 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/monitor_instances_summary_operations.py @@ -0,0 +1,129 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class MonitorInstancesSummaryOperations(object): + """MonitorInstancesSummaryOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-08-31-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-31-preview" + + self.config = config + + def list( + self, select=None, filter=None, apply=None, orderby=None, expand=None, top=None, skiptoken=None, custom_headers=None, raw=False, **operation_config): + """Get subscription wide health instances. + + :param select: Properties to be returned in the response. + :type select: str + :param filter: Filter to be applied on the operation. + :type filter: str + :param apply: Apply aggregation. + :type apply: str + :param orderby: Sort the result on one or more properties. + :type orderby: str + :param expand: Include properties inline in the response. + :type expand: str + :param top: Limit the result to the specified number of rows. + :type top: str + :param skiptoken: The page-continuation token to use with a paged + version of this API. + :type skiptoken: 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`. + :return: An iterator like instance of MonitorInstance + :rtype: + ~azure.mgmt.workloadmonitor.models.MonitorInstancePaged[~azure.mgmt.workloadmonitor.models.MonitorInstance] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + + else: + url = next_link + query_parameters = {} + + # 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) + + return response + + # Deserialize response + deserialized = models.MonitorInstancePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MonitorInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.WorkloadMonitor/monitorInstancesSummary'} diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/monitors_operations.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/monitors_operations.py new file mode 100644 index 000000000000..5c108cdf7e1a --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/monitors_operations.py @@ -0,0 +1,270 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class MonitorsOperations(object): + """MonitorsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-08-31-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-31-preview" + + self.config = config + + def list_by_resource( + self, resource_group_name, resource_namespace, resource_type, resource_name, filter=None, skiptoken=None, custom_headers=None, raw=False, **operation_config): + """Get list of a monitors of a resource. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :param filter: Filter to be applied on the operation. + :type filter: str + :param skiptoken: The page-continuation token to use with a paged + version of this API. + :type skiptoken: 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`. + :return: An iterator like instance of Monitor + :rtype: + ~azure.mgmt.workloadmonitor.models.MonitorPaged[~azure.mgmt.workloadmonitor.models.Monitor] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + + else: + url = next_link + query_parameters = {} + + # 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) + + return response + + # Deserialize response + deserialized = models.MonitorPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MonitorPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/monitors'} + + def get( + self, resource_group_name, resource_namespace, resource_type, resource_name, monitor_id, custom_headers=None, raw=False, **operation_config): + """Get details of a single monitor. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :param monitor_id: Monitor Id. + :type monitor_id: 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`. + :return: Monitor or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.workloadmonitor.models.Monitor or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'monitorId': self._serialize.url("monitor_id", monitor_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + 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('Monitor', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/monitors/{monitorId}'} + + def update( + self, resource_group_name, resource_namespace, resource_type, resource_name, monitor_id, custom_headers=None, raw=False, **operation_config): + """Update a Monitor's configuration. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :param monitor_id: Monitor Id. + :type monitor_id: 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`. + :return: Monitor or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.workloadmonitor.models.Monitor or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + body = None + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'monitorId': self._serialize.url("monitor_id", monitor_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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 body + body_content = self._serialize.body(body, 'Monitor') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + 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('Monitor', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/monitors/{monitorId}'} diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py new file mode 100644 index 000000000000..27af9b065e5b --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py @@ -0,0 +1,264 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class NotificationSettingsOperations(object): + """NotificationSettingsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-08-31-preview". + :ivar notification_setting_name: Default string modeled as parameter for URL to work correctly. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-31-preview" + self.notification_setting_name = "default" + + self.config = config + + def list_by_resource( + self, resource_group_name, resource_namespace, resource_type, resource_name, skiptoken=None, custom_headers=None, raw=False, **operation_config): + """Get list of notification settings for a resource. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :param skiptoken: The page-continuation token to use with a paged + version of this API. + :type skiptoken: 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`. + :return: An iterator like instance of NotificationSetting + :rtype: + ~azure.mgmt.workloadmonitor.models.NotificationSettingPaged[~azure.mgmt.workloadmonitor.models.NotificationSetting] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + + else: + url = next_link + query_parameters = {} + + # 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) + + return response + + # Deserialize response + deserialized = models.NotificationSettingPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.NotificationSettingPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/notificationSettings'} + + def get( + self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): + """Get a of notification setting for a resource. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: 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`. + :return: NotificationSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.workloadmonitor.models.NotificationSetting or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'notificationSettingName': self._serialize.url("self.notification_setting_name", self.notification_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + 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('NotificationSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/notificationSettings/{notificationSettingName}'} + + def update( + self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): + """Update notification settings for a resource. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: 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`. + :return: NotificationSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.workloadmonitor.models.NotificationSetting or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + body = None + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'notificationSettingName': self._serialize.url("self.notification_setting_name", self.notification_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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 body + body_content = self._serialize.body(body, 'NotificationSetting') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + 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('NotificationSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/notificationSettings/{notificationSettingName}'} diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/operations.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/operations.py new file mode 100644 index 000000000000..510fa97e447d --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/operations.py @@ -0,0 +1,103 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-08-31-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-31-preview" + + self.config = config + + def list( + self, skiptoken=None, custom_headers=None, raw=False, **operation_config): + """Gets the details of all operations possible on the resource provider. + + :param skiptoken: The page-continuation token to use with a paged + version of this API. + :type skiptoken: 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`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.workloadmonitor.models.OperationPaged[~azure.mgmt.workloadmonitor.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + + else: + url = next_link + query_parameters = {} + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.WorkloadMonitor/operations'} diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/version.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/version.py new file mode 100644 index 000000000000..fb0159ed93d7 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/version.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/workload_monitor_api.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/workload_monitor_api.py new file mode 100644 index 000000000000..76bad46011ec --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/workload_monitor_api.py @@ -0,0 +1,111 @@ +# 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.monitors_operations import MonitorsOperations +from .operations.components_operations import ComponentsOperations +from .operations.monitor_instances_operations import MonitorInstancesOperations +from .operations.notification_settings_operations import NotificationSettingsOperations +from .operations.components_summary_operations import ComponentsSummaryOperations +from .operations.monitor_instances_summary_operations import MonitorInstancesSummaryOperations +from .operations.operations import Operations +from . import models + + +class WorkloadMonitorAPIConfiguration(AzureConfiguration): + """Configuration for WorkloadMonitorAPI + 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` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' 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(WorkloadMonitorAPIConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-workloadmonitor/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class WorkloadMonitorAPI(SDKClient): + """APIs for workload monitoring + + :ivar config: Configuration for client. + :vartype config: WorkloadMonitorAPIConfiguration + + :ivar monitors: Monitors operations + :vartype monitors: azure.mgmt.workloadmonitor.operations.MonitorsOperations + :ivar components: Components operations + :vartype components: azure.mgmt.workloadmonitor.operations.ComponentsOperations + :ivar monitor_instances: MonitorInstances operations + :vartype monitor_instances: azure.mgmt.workloadmonitor.operations.MonitorInstancesOperations + :ivar notification_settings: NotificationSettings operations + :vartype notification_settings: azure.mgmt.workloadmonitor.operations.NotificationSettingsOperations + :ivar components_summary: ComponentsSummary operations + :vartype components_summary: azure.mgmt.workloadmonitor.operations.ComponentsSummaryOperations + :ivar monitor_instances_summary: MonitorInstancesSummary operations + :vartype monitor_instances_summary: azure.mgmt.workloadmonitor.operations.MonitorInstancesSummaryOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.workloadmonitor.operations.Operations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = WorkloadMonitorAPIConfiguration(credentials, subscription_id, base_url) + super(WorkloadMonitorAPI, 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 = '2018-08-31-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.monitors = MonitorsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.components = ComponentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.monitor_instances = MonitorInstancesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.notification_settings = NotificationSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.components_summary = ComponentsSummaryOperations( + self._client, self.config, self._serialize, self._deserialize) + self.monitor_instances_summary = MonitorInstancesSummaryOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-workloadmonitor/sdk_packaging.toml b/azure-mgmt-workloadmonitor/sdk_packaging.toml new file mode 100644 index 000000000000..46403409eb30 --- /dev/null +++ b/azure-mgmt-workloadmonitor/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-workloadmonitor" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Workload Monitor" +package_doc_id = "" +is_stable = false +is_arm = true diff --git a/azure-mgmt-workloadmonitor/setup.cfg b/azure-mgmt-workloadmonitor/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/azure-mgmt-workloadmonitor/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/azure-mgmt-workloadmonitor/setup.py b/azure-mgmt-workloadmonitor/setup.py new file mode 100644 index 000000000000..e398abd0963c --- /dev/null +++ b/azure-mgmt-workloadmonitor/setup.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-workloadmonitor" +PACKAGE_PPRINT_NAME = "Workload Monitor" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +)