Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,44 +31,28 @@ class InsightsManagementClientConfiguration(AzureConfiguration):
object<msrestazure.azure_active_directory>`
:param subscription_id: The Azure subscription Id.
:type subscription_id: str
:param accept_language: Gets or sets the preferred language for the
response.
:type accept_language: str
:param long_running_operation_retry_timeout: Gets or sets the retry
timeout in seconds for Long Running Operations. Default value is 30.
:type long_running_operation_retry_timeout: int
:param generate_client_request_id: When set to true a unique
x-ms-client-request-id value is generated and included in each request.
Default is true.
:type generate_client_request_id: bool
:param str base_url: Service URL
:param str filepath: Existing config
"""

def __init__(
self, credentials, subscription_id, accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None):
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 isinstance(subscription_id, str):
raise TypeError("Parameter 'subscription_id' must be str.")
if accept_language is not None and not isinstance(accept_language, str):
raise TypeError("Optional parameter 'accept_language' must be str.")
if not base_url:
base_url = 'https://management.azure.com'

super(InsightsManagementClientConfiguration, self).__init__(base_url, filepath)
super(InsightsManagementClientConfiguration, self).__init__(base_url)

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

self.credentials = credentials
self.subscription_id = subscription_id
self.accept_language = accept_language
self.long_running_operation_retry_timeout = long_running_operation_retry_timeout
self.generate_client_request_id = generate_client_request_id


class InsightsManagementClient(object):
Expand All @@ -93,24 +77,13 @@ class InsightsManagementClient(object):
object<msrestazure.azure_active_directory>`
:param subscription_id: The Azure subscription Id.
:type subscription_id: str
:param accept_language: Gets or sets the preferred language for the
response.
:type accept_language: str
:param long_running_operation_retry_timeout: Gets or sets the retry
timeout in seconds for Long Running Operations. Default value is 30.
:type long_running_operation_retry_timeout: int
:param generate_client_request_id: When set to true a unique
x-ms-client-request-id value is generated and included in each request.
Default is true.
:type generate_client_request_id: bool
:param str base_url: Service URL
:param str filepath: Existing config
"""

def __init__(
self, credentials, subscription_id, accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None):
self, credentials, subscription_id, base_url=None):

self.config = InsightsManagementClientConfiguration(credentials, subscription_id, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath)
self.config = InsightsManagementClientConfiguration(credentials, subscription_id, base_url)
self._client = ServiceClient(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
Expand Down
4 changes: 0 additions & 4 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from .retention_policy import RetentionPolicy
from .metric_settings import MetricSettings
from .log_settings import LogSettings
from .service_diagnostic_settings import ServiceDiagnosticSettings
from .service_diagnostic_settings_resource import ServiceDiagnosticSettingsResource
from .rule_condition import RuleCondition
from .rule_data_source import RuleDataSource
Expand All @@ -41,7 +40,6 @@
from .rule_webhook_action import RuleWebhookAction
from .alert_rule_resource import AlertRuleResource
from .incident import Incident
from .log_profile_properties import LogProfileProperties
from .log_profile_resource import LogProfileResource
from .autoscale_setting_resource_paged import AutoscaleSettingResourcePaged
from .alert_rule_resource_paged import AlertRuleResourcePaged
Expand Down Expand Up @@ -75,7 +73,6 @@
'RetentionPolicy',
'MetricSettings',
'LogSettings',
'ServiceDiagnosticSettings',
'ServiceDiagnosticSettingsResource',
'RuleCondition',
'RuleDataSource',
Expand All @@ -91,7 +88,6 @@
'RuleWebhookAction',
'AlertRuleResource',
'Incident',
'LogProfileProperties',
'LogProfileResource',
'AutoscaleSettingResourcePaged',
'AlertRuleResourcePaged',
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class LogProfileResource(Resource):
'id': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
'storage_account_id': {'required': True},
'locations': {'required': True},
}

Expand All @@ -70,7 +69,7 @@ class LogProfileResource(Resource):
'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicy'},
}

def __init__(self, location, storage_account_id, locations, name=None, tags=None, service_bus_rule_id=None, categories=None, retention_policy=None):
def __init__(self, location, locations, name=None, tags=None, storage_account_id=None, service_bus_rule_id=None, categories=None, retention_policy=None):
super(LogProfileResource, self).__init__(name=name, location=location, tags=tags)
self.storage_account_id = storage_account_id
self.service_bus_rule_id = service_bus_rule_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
class RecurrentSchedule(Model):
"""The scheduling constraints for when the profile begins.

:param time_zone: the time zone for the hours of the profile. See examples
of valid timezone are: Dateline Standard Time, UTC-11, Hawaiian Standard
:param time_zone: the timezone for the hours of the profile. Some examples
of valid timezones are: Dateline Standard Time, UTC-11, Hawaiian Standard
Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific
Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico),
Mountain Standard Time, Central America Standard Time, Central Standard
Expand Down

This file was deleted.

41 changes: 38 additions & 3 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/time_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,44 @@
class TimeWindow(Model):
"""A specific date-time for the profile.

:param time_zone: the time zone of the start and end times for the
profile. See examples of valid timezone ids over here:
https://msdn.microsoft.com/en-us/library/azure/dn931928.aspx
:param time_zone: the timezone of the start and end times for the profile.
Some examples of valid timezones are: Dateline Standard Time, UTC-11,
Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time
(Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain
Standard Time (Mexico), Mountain Standard Time, Central America Standard
Time, Central Standard Time, Central Standard Time (Mexico), Canada
Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US
Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time,
Atlantic Standard Time, Central Brazilian Standard Time, SA Western
Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E.
South America Standard Time, Argentina Standard Time, SA Eastern Standard
Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard
Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde
Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich
Standard Time, W. Europe Standard Time, Central Europe Standard Time,
Romance Standard Time, Central European Standard Time, W. Central Africa
Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard
Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time,
E. Europe Standard Time, South Africa Standard Time, FLE Standard Time,
Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time,
Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus
Standard Time, Russian Standard Time, E. Africa Standard Time, Iran
Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia
Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus
Standard Time, Afghanistan Standard Time, West Asia Standard Time,
Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time,
Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time,
Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard
Time, SE Asia Standard Time, North Asia Standard Time, China Standard
Time, North Asia East Standard Time, Singapore Standard Time, W. Australia
Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo
Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia
Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS
Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time,
Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10,
Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard
Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard
Time, Samoa Standard Time, Line Islands Standard Time
:type time_zone: str
:param start: the start time for the profile in ISO 8601 format.
:type start: datetime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ def create_or_update(
:param log_profile_name: The name of the log profile.
:type log_profile_name: str
:param parameters: Parameters supplied to the operation.
:type parameters: :class:`LogProfileProperties
<azure.mgmt.monitor.models.LogProfileProperties>`
:type parameters: :class:`LogProfileResource
<azure.mgmt.monitor.models.LogProfileResource>`
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand Down Expand Up @@ -188,7 +188,7 @@ def create_or_update(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct body
body_content = self._serialize.body(parameters, 'LogProfileProperties')
body_content = self._serialize.body(parameters, 'LogProfileResource')

# Construct and send request
request = self._client.put(url, query_parameters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ def get(
# Construct URL
url = '/{resourceUri}/providers/microsoft.insights/diagnosticSettings/service'
path_format_arguments = {
'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

Expand Down Expand Up @@ -101,8 +100,8 @@ def create_or_update(
:param resource_uri: The identifier of the resource.
:type resource_uri: str
:param parameters: Parameters supplied to the operation.
:type parameters: :class:`ServiceDiagnosticSettings
<azure.mgmt.monitor.models.ServiceDiagnosticSettings>`
:type parameters: :class:`ServiceDiagnosticSettingsResource
<azure.mgmt.monitor.models.ServiceDiagnosticSettingsResource>`
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -117,8 +116,7 @@ def create_or_update(
# Construct URL
url = '/{resourceUri}/providers/microsoft.insights/diagnosticSettings/service'
path_format_arguments = {
'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

Expand All @@ -137,7 +135,7 @@ def create_or_update(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct body
body_content = self._serialize.body(parameters, 'ServiceDiagnosticSettings')
body_content = self._serialize.body(parameters, 'ServiceDiagnosticSettingsResource')

# Construct and send request
request = self._client.put(url, query_parameters)
Expand Down
Loading