diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py index 58363a42dcc0..d2978d0436aa 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py @@ -114,6 +114,12 @@ from .log_to_metric_action_py3 import LogToMetricAction from .metric_namespace_name_py3 import MetricNamespaceName from .metric_namespace_py3 import MetricNamespace + from .proxy_resource_py3 import ProxyResource + from .error_py3 import Error + from .response_with_error_py3 import ResponseWithError, ResponseWithErrorException + from .workspace_info_py3 import WorkspaceInfo + from .data_container_py3 import DataContainer + from .vm_insights_onboarding_status_py3 import VMInsightsOnboardingStatus except (SyntaxError, ImportError): from .resource import Resource from .scale_capacity import ScaleCapacity @@ -219,6 +225,12 @@ from .log_to_metric_action import LogToMetricAction from .metric_namespace_name import MetricNamespaceName from .metric_namespace import MetricNamespace + from .proxy_resource import ProxyResource + from .error import Error + from .response_with_error import ResponseWithError, ResponseWithErrorException + from .workspace_info import WorkspaceInfo + from .data_container import DataContainer + from .vm_insights_onboarding_status import VMInsightsOnboardingStatus from .autoscale_setting_resource_paged import AutoscaleSettingResourcePaged from .incident_paged import IncidentPaged from .alert_rule_resource_paged import AlertRuleResourcePaged @@ -252,6 +264,8 @@ ConditionalOperator, MetricTriggerType, AlertSeverity, + OnboardingStatus, + DataStatus, ResultType, ) @@ -360,6 +374,12 @@ 'LogToMetricAction', 'MetricNamespaceName', 'MetricNamespace', + 'ProxyResource', + 'Error', + 'ResponseWithError', 'ResponseWithErrorException', + 'WorkspaceInfo', + 'DataContainer', + 'VMInsightsOnboardingStatus', 'AutoscaleSettingResourcePaged', 'IncidentPaged', 'AlertRuleResourcePaged', @@ -392,5 +412,7 @@ 'ConditionalOperator', 'MetricTriggerType', 'AlertSeverity', + 'OnboardingStatus', + 'DataStatus', 'ResultType', ] diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/data_container.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/data_container.py new file mode 100644 index 000000000000..175998582146 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/data_container.py @@ -0,0 +1,34 @@ +# 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 DataContainer(Model): + """Information about a container with data for a given resource. + + All required parameters must be populated in order to send to Azure. + + :param workspace: Required. Log Analytics workspace information. + :type workspace: ~azure.mgmt.monitor.models.WorkspaceInfo + """ + + _validation = { + 'workspace': {'required': True}, + } + + _attribute_map = { + 'workspace': {'key': 'workspace', 'type': 'WorkspaceInfo'}, + } + + def __init__(self, **kwargs): + super(DataContainer, self).__init__(**kwargs) + self.workspace = kwargs.get('workspace', None) diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/data_container_py3.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/data_container_py3.py new file mode 100644 index 000000000000..76b3b81f984b --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/data_container_py3.py @@ -0,0 +1,34 @@ +# 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 DataContainer(Model): + """Information about a container with data for a given resource. + + All required parameters must be populated in order to send to Azure. + + :param workspace: Required. Log Analytics workspace information. + :type workspace: ~azure.mgmt.monitor.models.WorkspaceInfo + """ + + _validation = { + 'workspace': {'required': True}, + } + + _attribute_map = { + 'workspace': {'key': 'workspace', 'type': 'WorkspaceInfo'}, + } + + def __init__(self, *, workspace, **kwargs) -> None: + super(DataContainer, self).__init__(**kwargs) + self.workspace = workspace diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/error.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/error.py new file mode 100644 index 000000000000..cb534a038ce5 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/error.py @@ -0,0 +1,38 @@ +# 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 Error(Model): + """Error details. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Error code identifying the specific error. + :type code: str + :param message: Error message in the caller's locale. + :type message: str + """ + + _validation = { + 'code': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/error_py3.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/error_py3.py new file mode 100644 index 000000000000..d75aa4e7a12d --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/error_py3.py @@ -0,0 +1,38 @@ +# 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 Error(Model): + """Error details. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Error code identifying the specific error. + :type code: str + :param message: Error message in the caller's locale. + :type message: str + """ + + _validation = { + 'code': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str, message: str=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/monitor_management_client_enums.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/monitor_management_client_enums.py index 20e7684fe31a..034dcdfe187d 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/monitor_management_client_enums.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/monitor_management_client_enums.py @@ -176,6 +176,19 @@ class AlertSeverity(str, Enum): four = "4" +class OnboardingStatus(str, Enum): + + onboarded = "onboarded" + not_onboarded = "notOnboarded" + unknown = "unknown" + + +class DataStatus(str, Enum): + + present = "present" + not_present = "notPresent" + + class ResultType(str, Enum): data = "Data" diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/proxy_resource.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/proxy_resource.py new file mode 100644 index 000000000000..91deff28bac8 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/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 msrest.serialization import Model + + +class ProxyResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :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) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/proxy_resource_py3.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/proxy_resource_py3.py new file mode 100644 index 000000000000..1ffcbec36014 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/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 msrest.serialization import Model + + +class ProxyResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :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) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/response_with_error.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/response_with_error.py new file mode 100644 index 000000000000..08c684bef0cf --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/response_with_error.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 +from msrest.exceptions import HttpOperationError + + +class ResponseWithError(Model): + """An error response from the API. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. Error information. + :type error: ~azure.mgmt.monitor.models.Error + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, **kwargs): + super(ResponseWithError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ResponseWithErrorException(HttpOperationError): + """Server responsed with exception of type: 'ResponseWithError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ResponseWithErrorException, self).__init__(deserialize, response, 'ResponseWithError', *args) diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/response_with_error_py3.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/response_with_error_py3.py new file mode 100644 index 000000000000..c3a89226d2fb --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/response_with_error_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 +from msrest.exceptions import HttpOperationError + + +class ResponseWithError(Model): + """An error response from the API. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. Error information. + :type error: ~azure.mgmt.monitor.models.Error + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, *, error, **kwargs) -> None: + super(ResponseWithError, self).__init__(**kwargs) + self.error = error + + +class ResponseWithErrorException(HttpOperationError): + """Server responsed with exception of type: 'ResponseWithError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ResponseWithErrorException, self).__init__(deserialize, response, 'ResponseWithError', *args) diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/vm_insights_onboarding_status.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/vm_insights_onboarding_status.py new file mode 100644 index 000000000000..b641f7acb264 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/vm_insights_onboarding_status.py @@ -0,0 +1,72 @@ +# 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 VMInsightsOnboardingStatus(ProxyResource): + """VM Insights onboarding status for a 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: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param resource_id: Required. Azure Resource Manager identifier of the + resource whose onboarding status is being represented. + :type resource_id: str + :param onboarding_status: Required. The onboarding status for the + resource. Note that, a higher level scope, e.g., resource group or + subscription, is considered onboarded if at least one resource under it is + onboarded. Possible values include: 'onboarded', 'notOnboarded', 'unknown' + :type onboarding_status: str or + ~azure.mgmt.monitor.models.OnboardingStatus + :param data_status: Required. The status of VM Insights data from the + resource. When reported as `present` the data array will contain + information about the data containers to which data for the specified + resource is being routed. Possible values include: 'present', 'notPresent' + :type data_status: str or ~azure.mgmt.monitor.models.DataStatus + :param data: Containers that currently store VM Insights data for the + specified resource. + :type data: list[~azure.mgmt.monitor.models.DataContainer] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_id': {'required': True}, + 'onboarding_status': {'required': True}, + 'data_status': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'onboarding_status': {'key': 'properties.onboardingStatus', 'type': 'str'}, + 'data_status': {'key': 'properties.dataStatus', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': '[DataContainer]'}, + } + + def __init__(self, **kwargs): + super(VMInsightsOnboardingStatus, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.onboarding_status = kwargs.get('onboarding_status', None) + self.data_status = kwargs.get('data_status', None) + self.data = kwargs.get('data', None) diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/vm_insights_onboarding_status_py3.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/vm_insights_onboarding_status_py3.py new file mode 100644 index 000000000000..37c77ecc1a8a --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/vm_insights_onboarding_status_py3.py @@ -0,0 +1,72 @@ +# 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 VMInsightsOnboardingStatus(ProxyResource): + """VM Insights onboarding status for a 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: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param resource_id: Required. Azure Resource Manager identifier of the + resource whose onboarding status is being represented. + :type resource_id: str + :param onboarding_status: Required. The onboarding status for the + resource. Note that, a higher level scope, e.g., resource group or + subscription, is considered onboarded if at least one resource under it is + onboarded. Possible values include: 'onboarded', 'notOnboarded', 'unknown' + :type onboarding_status: str or + ~azure.mgmt.monitor.models.OnboardingStatus + :param data_status: Required. The status of VM Insights data from the + resource. When reported as `present` the data array will contain + information about the data containers to which data for the specified + resource is being routed. Possible values include: 'present', 'notPresent' + :type data_status: str or ~azure.mgmt.monitor.models.DataStatus + :param data: Containers that currently store VM Insights data for the + specified resource. + :type data: list[~azure.mgmt.monitor.models.DataContainer] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_id': {'required': True}, + 'onboarding_status': {'required': True}, + 'data_status': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'onboarding_status': {'key': 'properties.onboardingStatus', 'type': 'str'}, + 'data_status': {'key': 'properties.dataStatus', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': '[DataContainer]'}, + } + + def __init__(self, *, resource_id: str, onboarding_status, data_status, data=None, **kwargs) -> None: + super(VMInsightsOnboardingStatus, self).__init__(**kwargs) + self.resource_id = resource_id + self.onboarding_status = onboarding_status + self.data_status = data_status + self.data = data diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/workspace_info.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/workspace_info.py new file mode 100644 index 000000000000..23f3cde153ef --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/workspace_info.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 WorkspaceInfo(Model): + """Information about a Log Analytics Workspace. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Azure Resource Manager identifier of the Log + Analytics Workspace. + :type id: str + :param location: Required. Location of the Log Analytics workspace. + :type location: str + :param customer_id: Required. Log Analytics workspace identifier. + :type customer_id: str + """ + + _validation = { + 'id': {'required': True}, + 'location': {'required': True}, + 'customer_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'customer_id': {'key': 'properties.customerId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkspaceInfo, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.location = kwargs.get('location', None) + self.customer_id = kwargs.get('customer_id', None) diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/workspace_info_py3.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/workspace_info_py3.py new file mode 100644 index 000000000000..87430b030bd5 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/workspace_info_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 WorkspaceInfo(Model): + """Information about a Log Analytics Workspace. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Azure Resource Manager identifier of the Log + Analytics Workspace. + :type id: str + :param location: Required. Location of the Log Analytics workspace. + :type location: str + :param customer_id: Required. Log Analytics workspace identifier. + :type customer_id: str + """ + + _validation = { + 'id': {'required': True}, + 'location': {'required': True}, + 'customer_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'customer_id': {'key': 'properties.customerId', 'type': 'str'}, + } + + def __init__(self, *, id: str, location: str, customer_id: str, **kwargs) -> None: + super(WorkspaceInfo, self).__init__(**kwargs) + self.id = id + self.location = location + self.customer_id = customer_id diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/monitor_management_client.py b/azure-mgmt-monitor/azure/mgmt/monitor/monitor_management_client.py index 4580a30fc42e..7d44a529ad2f 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/monitor_management_client.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/monitor_management_client.py @@ -32,6 +32,7 @@ from .operations.metric_alerts_status_operations import MetricAlertsStatusOperations from .operations.scheduled_query_rules_operations import ScheduledQueryRulesOperations from .operations.metric_namespaces_operations import MetricNamespacesOperations +from .operations.vm_insights_operations import VMInsightsOperations from . import models @@ -111,6 +112,8 @@ class MonitorManagementClient(SDKClient): :vartype scheduled_query_rules: azure.mgmt.monitor.operations.ScheduledQueryRulesOperations :ivar metric_namespaces: MetricNamespaces operations :vartype metric_namespaces: azure.mgmt.monitor.operations.MetricNamespacesOperations + :ivar vm_insights: VMInsights operations + :vartype vm_insights: azure.mgmt.monitor.operations.VMInsightsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -168,3 +171,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.metric_namespaces = MetricNamespacesOperations( self._client, self.config, self._serialize, self._deserialize) + self.vm_insights = VMInsightsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/operations/__init__.py b/azure-mgmt-monitor/azure/mgmt/monitor/operations/__init__.py index bec73c3cf3a2..85645e686fc1 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/operations/__init__.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/operations/__init__.py @@ -28,6 +28,7 @@ from .metric_alerts_status_operations import MetricAlertsStatusOperations from .scheduled_query_rules_operations import ScheduledQueryRulesOperations from .metric_namespaces_operations import MetricNamespacesOperations +from .vm_insights_operations import VMInsightsOperations __all__ = [ 'AutoscaleSettingsOperations', @@ -49,4 +50,5 @@ 'MetricAlertsStatusOperations', 'ScheduledQueryRulesOperations', 'MetricNamespacesOperations', + 'VMInsightsOperations', ] diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/operations/vm_insights_operations.py b/azure-mgmt-monitor/azure/mgmt/monitor/operations/vm_insights_operations.py new file mode 100644 index 000000000000..408e2bd83d3a --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/operations/vm_insights_operations.py @@ -0,0 +1,96 @@ +# 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 VMInsightsOperations(object): + """VMInsightsOperations 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: API version. Constant value: "2018-11-27-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-27-preview" + + self.config = config + + def get_onboarding_status( + self, resource_uri, custom_headers=None, raw=False, **operation_config): + """Retrieves the VM Insights onboarding status for the specified resource + or resource scope. + + :param resource_uri: The fully qualified Azure Resource manager + identifier of the resource, or scope, whose status to retrieve. + :type resource_uri: 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: VMInsightsOnboardingStatus or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.VMInsightsOnboardingStatus or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ResponseWithErrorException` + """ + # Construct URL + url = self.get_onboarding_status.metadata['url'] + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True) + } + 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.ResponseWithErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VMInsightsOnboardingStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_onboarding_status.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default'} diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/version.py b/azure-mgmt-monitor/azure/mgmt/monitor/version.py index 266f5a486d79..5a7feab42d26 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/version.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.5.0" +VERSION = "0.6.0"