Skip to content

Commit

Permalink
Release azure-mgmt-monitor 0.10.0 (Azure#11873)
Browse files Browse the repository at this point in the history
* Release azure-mgmt-monitor 0.10.0

Add Missing Json in Readme for Monitor

* fix test and ship bad test (#1)

Co-authored-by: Kerwin Sun <sunkaihuisos@gmail.com>
  • Loading branch information
LianwMS and 00Kai0 authored Jun 15, 2020
1 parent debbb83 commit 04c842a
Show file tree
Hide file tree
Showing 18 changed files with 4,038 additions and 424 deletions.
11 changes: 11 additions & 0 deletions sdk/monitor/azure-mgmt-monitor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Release History

## 0.10.0 (2020-06-08)

**Features**

- Model WebtestLocationAvailabilityCriteria has a new parameter additional_properties
- Added operation group SubscriptionDiagnosticSettingsOperations

**Breaking changes**

- Model WebtestLocationAvailabilityCriteria has a new required parameter odatatype

## 0.9.0 (2020-04-09)

**Features**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class MonitorManagementClient(MultiApiClientMixin, SDKClient):
'operations': '2015-04-01',
'scheduled_query_rules': '2018-04-16',
'service_diagnostic_settings': '2016-09-01',
'subscription_diagnostic_settings': '2017-05-01-preview',
'tenant_activity_logs': '2015-04-01',
'vm_insights': '2018-11-27-preview',
}},
Expand Down Expand Up @@ -569,6 +570,19 @@ def service_diagnostic_settings(self):
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def subscription_diagnostic_settings(self):
"""Instance depends on the API version:
* 2017-05-01-preview: :class:`SubscriptionDiagnosticSettingsOperations<azure.mgmt.monitor.v2017_05_01_preview.operations.SubscriptionDiagnosticSettingsOperations>`
"""
api_version = self._get_api_version('subscription_diagnostic_settings')
if api_version == '2017-05-01-preview':
from .v2017_05_01_preview.operations import SubscriptionDiagnosticSettingsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def tenant_activity_logs(self):
"""Instance depends on the API version:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from .operations import DiagnosticSettingsOperations
from .operations import MetricDefinitionsOperations
from .operations import MetricsOperations
from .operations import SubscriptionDiagnosticSettingsOperations
from . import models


Expand All @@ -34,6 +35,8 @@ class MonitorManagementClient(SDKClient):
:vartype metric_definitions: azure.mgmt.monitor.v2017_05_01_preview.operations.MetricDefinitionsOperations
:ivar metrics: Metrics operations
:vartype metrics: azure.mgmt.monitor.v2017_05_01_preview.operations.MetricsOperations
:ivar subscription_diagnostic_settings: SubscriptionDiagnosticSettings operations
:vartype subscription_diagnostic_settings: azure.mgmt.monitor.v2017_05_01_preview.operations.SubscriptionDiagnosticSettingsOperations
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
Expand All @@ -60,3 +63,5 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.metrics = MetricsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.subscription_diagnostic_settings = SubscriptionDiagnosticSettingsOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
from ._models_py3 import ProxyOnlyResource
from ._models_py3 import Response
from ._models_py3 import RetentionPolicy
from ._models_py3 import SubscriptionDiagnosticSettingsResource
from ._models_py3 import SubscriptionDiagnosticSettingsResourceCollection
from ._models_py3 import SubscriptionLogSettings
from ._models_py3 import SubscriptionProxyOnlyResource
from ._models_py3 import TimeSeriesElement
except (SyntaxError, ImportError):
from ._models import DiagnosticSettingsCategoryResource
Expand All @@ -44,6 +48,10 @@
from ._models import ProxyOnlyResource
from ._models import Response
from ._models import RetentionPolicy
from ._models import SubscriptionDiagnosticSettingsResource
from ._models import SubscriptionDiagnosticSettingsResourceCollection
from ._models import SubscriptionLogSettings
from ._models import SubscriptionProxyOnlyResource
from ._models import TimeSeriesElement
from ._paged_models import MetricDefinitionPaged
from ._monitor_management_client_enums import (
Expand All @@ -70,6 +78,10 @@
'ProxyOnlyResource',
'Response',
'RetentionPolicy',
'SubscriptionDiagnosticSettingsResource',
'SubscriptionDiagnosticSettingsResourceCollection',
'SubscriptionLogSettings',
'SubscriptionProxyOnlyResource',
'TimeSeriesElement',
'MetricDefinitionPaged',
'CategoryType',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,153 @@ def __init__(self, **kwargs):
self.days = kwargs.get('days', None)


class SubscriptionProxyOnlyResource(Model):
"""A proxy only 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
:param location: Location of the resource
:type location: 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'},
'location': {'key': 'location', 'type': 'str'},
}

def __init__(self, **kwargs):
super(SubscriptionProxyOnlyResource, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.location = kwargs.get('location', None)


class SubscriptionDiagnosticSettingsResource(SubscriptionProxyOnlyResource):
"""The subscription diagnostic setting resource.
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
:param location: Location of the resource
:type location: str
:param storage_account_id: The resource ID of the storage account to which
you would like to send Diagnostic Logs.
:type storage_account_id: str
:param service_bus_rule_id: The service bus rule Id of the diagnostic
setting. This is here to maintain backwards compatibility.
:type service_bus_rule_id: str
:param event_hub_authorization_rule_id: The resource Id for the event hub
authorization rule.
:type event_hub_authorization_rule_id: str
:param event_hub_name: The name of the event hub. If none is specified,
the default event hub will be selected.
:type event_hub_name: str
:param logs: The list of logs settings.
:type logs:
list[~azure.mgmt.monitor.v2017_05_01_preview.models.SubscriptionLogSettings]
:param workspace_id: The full ARM resource ID of the Log Analytics
workspace to which you would like to send Diagnostic Logs. Example:
/subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2
:type workspace_id: 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'},
'location': {'key': 'location', 'type': 'str'},
'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'},
'service_bus_rule_id': {'key': 'properties.serviceBusRuleId', 'type': 'str'},
'event_hub_authorization_rule_id': {'key': 'properties.eventHubAuthorizationRuleId', 'type': 'str'},
'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'},
'logs': {'key': 'properties.logs', 'type': '[SubscriptionLogSettings]'},
'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'},
}

def __init__(self, **kwargs):
super(SubscriptionDiagnosticSettingsResource, self).__init__(**kwargs)
self.storage_account_id = kwargs.get('storage_account_id', None)
self.service_bus_rule_id = kwargs.get('service_bus_rule_id', None)
self.event_hub_authorization_rule_id = kwargs.get('event_hub_authorization_rule_id', None)
self.event_hub_name = kwargs.get('event_hub_name', None)
self.logs = kwargs.get('logs', None)
self.workspace_id = kwargs.get('workspace_id', None)


class SubscriptionDiagnosticSettingsResourceCollection(Model):
"""Represents a collection of subscription diagnostic settings resources.
:param value: The collection of subscription diagnostic settings
resources.
:type value:
list[~azure.mgmt.monitor.v2017_05_01_preview.models.SubscriptionDiagnosticSettingsResource]
"""

_attribute_map = {
'value': {'key': 'value', 'type': '[SubscriptionDiagnosticSettingsResource]'},
}

def __init__(self, **kwargs):
super(SubscriptionDiagnosticSettingsResourceCollection, self).__init__(**kwargs)
self.value = kwargs.get('value', None)


class SubscriptionLogSettings(Model):
"""Part of Subscription diagnostic setting. Specifies the settings for a
particular log.
All required parameters must be populated in order to send to Azure.
:param category: Name of a Subscription Diagnostic Log category for a
resource type this setting is applied to.
:type category: str
:param enabled: Required. a value indicating whether this log is enabled.
:type enabled: bool
"""

_validation = {
'enabled': {'required': True},
}

_attribute_map = {
'category': {'key': 'category', 'type': 'str'},
'enabled': {'key': 'enabled', 'type': 'bool'},
}

def __init__(self, **kwargs):
super(SubscriptionLogSettings, self).__init__(**kwargs)
self.category = kwargs.get('category', None)
self.enabled = kwargs.get('enabled', None)


class TimeSeriesElement(Model):
"""A time series result type. The discriminator value is always TimeSeries in
this case.
Expand Down
Loading

0 comments on commit 04c842a

Please sign in to comment.