From 068a61e1be762c5b7408e6e61270ef6fa5239d64 Mon Sep 17 00:00:00 2001 From: Liang Wang Date: Thu, 9 Apr 2020 05:20:57 +0000 Subject: [PATCH] Manually Release Monitor --- sdk/monitor/azure-mgmt-monitor/CHANGELOG.md | 16 +++ .../azure/mgmt/monitor/_configuration.py | 2 +- .../operations/_alert_rules_operations.py | 14 +- .../monitor/v2018_03_01/models/_models.py | 4 +- .../monitor/v2018_03_01/models/_models_py3.py | 4 +- .../monitor/v2019_10_17/_configuration.py | 2 +- .../v2019_10_17/_monitor_management_client.py | 2 +- .../monitor/v2019_10_17/models/__init__.py | 9 +- .../monitor/v2019_10_17/models/_models.py | 105 +++++++-------- .../monitor/v2019_10_17/models/_models_py3.py | 121 ++++++++---------- ...private_endpoint_connections_operations.py | 74 ++++++----- .../_private_link_resources_operations.py | 28 ++-- ..._link_scope_operation_status_operations.py | 11 +- ...rivate_link_scoped_resources_operations.py | 67 +++++----- .../_private_link_scopes_operations.py | 98 +++++++------- .../azure/mgmt/monitor/version.py | 2 +- 16 files changed, 280 insertions(+), 279 deletions(-) diff --git a/sdk/monitor/azure-mgmt-monitor/CHANGELOG.md b/sdk/monitor/azure-mgmt-monitor/CHANGELOG.md index ddd528b9ab1d6..d3915cffbd1a4 100644 --- a/sdk/monitor/azure-mgmt-monitor/CHANGELOG.md +++ b/sdk/monitor/azure-mgmt-monitor/CHANGELOG.md @@ -1,5 +1,21 @@ # Release History +## 0.9.0 (2020-04-09) + +**Features** + + - Model AzureMonitorPrivateLinkScope has a new parameter private_endpoint_connections + +**Breaking changes** + + - Operation PrivateLinkScopedResourcesOperations.create_or_update has a new signature + - Model PrivateEndpointConnection no longer has parameter tags + - Model PrivateLinkResource no longer has parameter tags + - Model ScopedResource no longer has parameter tags + - Model ProxyResource no longer has parameter tags + - Operation PrivateEndpointConnectionsOperations.create_or_update has a new signature + - Model ErrorResponse has a new signature + ## 0.8.0 (2020-03-14) **Features** diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py index c6ef8a63dfd28..88436f6b4a330 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py @@ -21,7 +21,7 @@ class MonitorManagementClientConfiguration(AzureConfiguration): :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. + :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL """ diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rules_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rules_operations.py index 25edadff78288..e92ab36d1b3bb 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rules_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rules_operations.py @@ -41,7 +41,7 @@ def __init__(self, client, config, serializer, deserializer): def create_or_update( self, resource_group_name, rule_name, parameters, custom_headers=None, raw=False, **operation_config): - """Creates or updates an alert rule. + """Creates or updates a classic metric alert rule. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -110,7 +110,7 @@ def create_or_update( def delete( self, resource_group_name, rule_name, custom_headers=None, raw=False, **operation_config): - """Deletes an alert rule. + """Deletes a classic metric alert rule. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -163,7 +163,7 @@ def delete( def get( self, resource_group_name, rule_name, custom_headers=None, raw=False, **operation_config): - """Gets an alert rule. + """Gets a classic metric alert rule. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -224,8 +224,8 @@ def get( def update( self, resource_group_name, rule_name, alert_rules_resource, custom_headers=None, raw=False, **operation_config): - """Updates an existing AlertRuleResource. To update other fields use the - CreateOrUpdate method. + """Updates an existing classic metric AlertRuleResource. To update other + fields use the CreateOrUpdate method. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -294,7 +294,7 @@ def update( def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """List the alert rules within a resource group. + """List the classic metric alert rules within a resource group. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -363,7 +363,7 @@ def internal_paging(next_link=None): def list_by_subscription( self, custom_headers=None, raw=False, **operation_config): - """List the alert rules within a subscription. + """List the classic metric alert rules within a subscription. :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models.py index 69a7f66bd1406..0dade9eb98f5e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models.py @@ -784,7 +784,7 @@ class MetricAlertResource(Resource): information. :type criteria: ~azure.mgmt.monitor.v2018_03_01.models.MetricAlertCriteria :param auto_mitigate: the flag that indicates whether the alert should be - auto resolved or not. + auto resolved or not. The default is true. :type auto_mitigate: bool :param actions: the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. @@ -883,7 +883,7 @@ class MetricAlertResourcePatch(Model): information. :type criteria: ~azure.mgmt.monitor.v2018_03_01.models.MetricAlertCriteria :param auto_mitigate: the flag that indicates whether the alert should be - auto resolved or not. + auto resolved or not. The default is true. :type auto_mitigate: bool :param actions: the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models_py3.py index e053f5e488d41..93f1496b31621 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models_py3.py @@ -784,7 +784,7 @@ class MetricAlertResource(Resource): information. :type criteria: ~azure.mgmt.monitor.v2018_03_01.models.MetricAlertCriteria :param auto_mitigate: the flag that indicates whether the alert should be - auto resolved or not. + auto resolved or not. The default is true. :type auto_mitigate: bool :param actions: the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. @@ -883,7 +883,7 @@ class MetricAlertResourcePatch(Model): information. :type criteria: ~azure.mgmt.monitor.v2018_03_01.models.MetricAlertCriteria :param auto_mitigate: the flag that indicates whether the alert should be - auto resolved or not. + auto resolved or not. The default is true. :type auto_mitigate: bool :param actions: the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_configuration.py index c6ef8a63dfd28..88436f6b4a330 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_configuration.py @@ -21,7 +21,7 @@ class MonitorManagementClientConfiguration(AzureConfiguration): :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. + :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL """ diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_management_client.py index 4ae97e2fb5c0b..166ebe25e5a79 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_management_client.py @@ -41,7 +41,7 @@ class MonitorManagementClient(SDKClient): :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. + :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL """ diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/__init__.py index 1c5f14f0e4ef1..2fd9ccad4204d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/__init__.py @@ -12,7 +12,8 @@ try: from ._models_py3 import AzureMonitorPrivateLinkScope from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import ErrorResponse + from ._models_py3 import ErrorResponseCommon from ._models_py3 import OperationStatus from ._models_py3 import PrivateEndpointConnection from ._models_py3 import PrivateEndpointProperty @@ -25,7 +26,8 @@ except (SyntaxError, ImportError): from ._models import AzureMonitorPrivateLinkScope from ._models import ErrorAdditionalInfo - from ._models import ErrorResponse, ErrorResponseException + from ._models import ErrorResponse + from ._models import ErrorResponseCommon from ._models import OperationStatus from ._models import PrivateEndpointConnection from ._models import PrivateEndpointProperty @@ -43,7 +45,8 @@ __all__ = [ 'AzureMonitorPrivateLinkScope', 'ErrorAdditionalInfo', - 'ErrorResponse', 'ErrorResponseException', + 'ErrorResponse', + 'ErrorResponseCommon', 'OperationStatus', 'PrivateEndpointConnection', 'PrivateEndpointProperty', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_models.py index 3000a8a2c424d..412d0db92326c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_models.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_models.py @@ -10,7 +10,6 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model -from msrest.exceptions import HttpOperationError class PrivateLinkScopesResource(Model): @@ -80,6 +79,9 @@ class AzureMonitorPrivateLinkScope(PrivateLinkScopesResource): Users cannot change this value but are able to read from it. Values will include Provisioning ,Succeeded, Canceled and Failed. :vartype provisioning_state: str + :ivar private_endpoint_connections: List of private endpoint connections. + :vartype private_endpoint_connections: + list[~azure.mgmt.monitor.v2019_10_17.models.PrivateEndpointConnection] """ _validation = { @@ -88,6 +90,7 @@ class AzureMonitorPrivateLinkScope(PrivateLinkScopesResource): 'type': {'readonly': True}, 'location': {'required': True}, 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -97,11 +100,13 @@ class AzureMonitorPrivateLinkScope(PrivateLinkScopesResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, } def __init__(self, **kwargs): super(AzureMonitorPrivateLinkScope, self).__init__(**kwargs) self.provisioning_state = None + self.private_endpoint_connections = None class CloudError(Model): @@ -141,29 +146,44 @@ def __init__(self, **kwargs): class ErrorResponse(Model): + """Describes the format of Error response. + + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ErrorResponseCommon(ErrorResponse): """The resource management error response. Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str :ivar details: The error details. :vartype details: - list[~azure.mgmt.monitor.v2019_10_17.models.ErrorResponse] + list[~azure.mgmt.monitor.v2019_10_17.models.ErrorResponseCommon] :ivar additional_info: The error additional info. :vartype additional_info: list[~azure.mgmt.monitor.v2019_10_17.models.ErrorAdditionalInfo] """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, 'details': {'readonly': True}, 'additional_info': {'readonly': True}, } @@ -171,32 +191,16 @@ class ErrorResponse(Model): _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'details': {'key': 'details', 'type': '[ErrorResponseCommon]'}, 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } def __init__(self, **kwargs): - super(ErrorResponse, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None + super(ErrorResponseCommon, self).__init__(**kwargs) self.details = None self.additional_info = 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) - - class OperationStatus(Model): """The status of operation. @@ -211,7 +215,7 @@ class OperationStatus(Model): :param status: The status of the operation. :type status: str :param error: The error detail of the operation if any. - :type error: ~azure.mgmt.monitor.v2019_10_17.models.ErrorResponse + :type error: ~azure.mgmt.monitor.v2019_10_17.models.ErrorResponseCommon """ _attribute_map = { @@ -220,7 +224,7 @@ class OperationStatus(Model): 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'ErrorResponse'}, + 'error': {'key': 'error', 'type': 'ErrorResponseCommon'}, } def __init__(self, **kwargs): @@ -234,19 +238,17 @@ def __init__(self, **kwargs): class ProxyResource(Model): - """Common properties of proxy resource. + """An azure resource object. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Azure resource Id :vartype id: str - :ivar name: Resource name. + :ivar name: Azure resource name :vartype name: str - :ivar type: Resource type. + :ivar type: Azure resource type :vartype type: str - :param tags: Resource tags - :type tags: dict[str, str] """ _validation = { @@ -259,7 +261,6 @@ class ProxyResource(Model): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, } def __init__(self, **kwargs): @@ -267,7 +268,6 @@ def __init__(self, **kwargs): self.id = None self.name = None self.type = None - self.tags = kwargs.get('tags', None) class PrivateEndpointConnection(ProxyResource): @@ -276,14 +276,12 @@ class PrivateEndpointConnection(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Azure resource Id :vartype id: str - :ivar name: Resource name. + :ivar name: Azure resource name :vartype name: str - :ivar type: Resource type. + :ivar type: Azure resource type :vartype type: str - :param tags: Resource tags - :type tags: dict[str, str] :param private_endpoint: Private endpoint which the connection belongs to. :type private_endpoint: ~azure.mgmt.monitor.v2019_10_17.models.PrivateEndpointProperty @@ -306,7 +304,6 @@ class PrivateEndpointConnection(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointProperty'}, 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateProperty'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, @@ -341,14 +338,12 @@ class PrivateLinkResource(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Azure resource Id :vartype id: str - :ivar name: Resource name. + :ivar name: Azure resource name :vartype name: str - :ivar type: Resource type. + :ivar type: Azure resource type :vartype type: str - :param tags: Resource tags - :type tags: dict[str, str] :ivar group_id: The private link resource group id. :vartype group_id: str :ivar required_members: The private link resource required member names. @@ -367,7 +362,6 @@ class PrivateLinkResource(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, 'group_id': {'key': 'properties.groupId', 'type': 'str'}, 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, } @@ -421,14 +415,12 @@ class ScopedResource(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Azure resource Id :vartype id: str - :ivar name: Resource name. + :ivar name: Azure resource name :vartype name: str - :ivar type: Resource type. + :ivar type: Azure resource type :vartype type: str - :param tags: Resource tags - :type tags: dict[str, str] :param linked_resource_id: The resource id of the scoped Azure monitor resource. :type linked_resource_id: str @@ -447,7 +439,6 @@ class ScopedResource(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, 'linked_resource_id': {'key': 'properties.linkedResourceId', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_models_py3.py index 56a08b9b57f0a..43d3d861981f7 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_models_py3.py @@ -10,7 +10,6 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model -from msrest.exceptions import HttpOperationError class PrivateLinkScopesResource(Model): @@ -80,6 +79,9 @@ class AzureMonitorPrivateLinkScope(PrivateLinkScopesResource): Users cannot change this value but are able to read from it. Values will include Provisioning ,Succeeded, Canceled and Failed. :vartype provisioning_state: str + :ivar private_endpoint_connections: List of private endpoint connections. + :vartype private_endpoint_connections: + list[~azure.mgmt.monitor.v2019_10_17.models.PrivateEndpointConnection] """ _validation = { @@ -88,6 +90,7 @@ class AzureMonitorPrivateLinkScope(PrivateLinkScopesResource): 'type': {'readonly': True}, 'location': {'required': True}, 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -97,11 +100,13 @@ class AzureMonitorPrivateLinkScope(PrivateLinkScopesResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, } def __init__(self, *, location: str, tags=None, **kwargs) -> None: super(AzureMonitorPrivateLinkScope, self).__init__(location=location, tags=tags, **kwargs) self.provisioning_state = None + self.private_endpoint_connections = None class CloudError(Model): @@ -141,29 +146,44 @@ def __init__(self, **kwargs) -> None: class ErrorResponse(Model): + """Describes the format of Error response. + + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ErrorResponseCommon(ErrorResponse): """The resource management error response. Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str :ivar details: The error details. :vartype details: - list[~azure.mgmt.monitor.v2019_10_17.models.ErrorResponse] + list[~azure.mgmt.monitor.v2019_10_17.models.ErrorResponseCommon] :ivar additional_info: The error additional info. :vartype additional_info: list[~azure.mgmt.monitor.v2019_10_17.models.ErrorAdditionalInfo] """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, 'details': {'readonly': True}, 'additional_info': {'readonly': True}, } @@ -171,32 +191,16 @@ class ErrorResponse(Model): _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'details': {'key': 'details', 'type': '[ErrorResponseCommon]'}, 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } - def __init__(self, **kwargs) -> None: - super(ErrorResponse, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(ErrorResponseCommon, self).__init__(code=code, message=message, **kwargs) self.details = None self.additional_info = 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) - - class OperationStatus(Model): """The status of operation. @@ -211,7 +215,7 @@ class OperationStatus(Model): :param status: The status of the operation. :type status: str :param error: The error detail of the operation if any. - :type error: ~azure.mgmt.monitor.v2019_10_17.models.ErrorResponse + :type error: ~azure.mgmt.monitor.v2019_10_17.models.ErrorResponseCommon """ _attribute_map = { @@ -220,7 +224,7 @@ class OperationStatus(Model): 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'ErrorResponse'}, + 'error': {'key': 'error', 'type': 'ErrorResponseCommon'}, } def __init__(self, *, id: str=None, name: str=None, start_time=None, end_time=None, status: str=None, error=None, **kwargs) -> None: @@ -234,19 +238,17 @@ def __init__(self, *, id: str=None, name: str=None, start_time=None, end_time=No class ProxyResource(Model): - """Common properties of proxy resource. + """An azure resource object. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Azure resource Id :vartype id: str - :ivar name: Resource name. + :ivar name: Azure resource name :vartype name: str - :ivar type: Resource type. + :ivar type: Azure resource type :vartype type: str - :param tags: Resource tags - :type tags: dict[str, str] """ _validation = { @@ -259,15 +261,13 @@ class ProxyResource(Model): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, tags=None, **kwargs) -> None: + def __init__(self, **kwargs) -> None: super(ProxyResource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.tags = tags class PrivateEndpointConnection(ProxyResource): @@ -276,14 +276,12 @@ class PrivateEndpointConnection(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Azure resource Id :vartype id: str - :ivar name: Resource name. + :ivar name: Azure resource name :vartype name: str - :ivar type: Resource type. + :ivar type: Azure resource type :vartype type: str - :param tags: Resource tags - :type tags: dict[str, str] :param private_endpoint: Private endpoint which the connection belongs to. :type private_endpoint: ~azure.mgmt.monitor.v2019_10_17.models.PrivateEndpointProperty @@ -306,14 +304,13 @@ class PrivateEndpointConnection(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointProperty'}, 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateProperty'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, *, tags=None, private_endpoint=None, private_link_service_connection_state=None, **kwargs) -> None: - super(PrivateEndpointConnection, self).__init__(tags=tags, **kwargs) + def __init__(self, *, private_endpoint=None, private_link_service_connection_state=None, **kwargs) -> None: + super(PrivateEndpointConnection, self).__init__(**kwargs) self.private_endpoint = private_endpoint self.private_link_service_connection_state = private_link_service_connection_state self.provisioning_state = None @@ -341,14 +338,12 @@ class PrivateLinkResource(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Azure resource Id :vartype id: str - :ivar name: Resource name. + :ivar name: Azure resource name :vartype name: str - :ivar type: Resource type. + :ivar type: Azure resource type :vartype type: str - :param tags: Resource tags - :type tags: dict[str, str] :ivar group_id: The private link resource group id. :vartype group_id: str :ivar required_members: The private link resource required member names. @@ -367,13 +362,12 @@ class PrivateLinkResource(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, 'group_id': {'key': 'properties.groupId', 'type': 'str'}, 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, } - def __init__(self, *, tags=None, **kwargs) -> None: - super(PrivateLinkResource, self).__init__(tags=tags, **kwargs) + def __init__(self, **kwargs) -> None: + super(PrivateLinkResource, self).__init__(**kwargs) self.group_id = None self.required_members = None @@ -421,14 +415,12 @@ class ScopedResource(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. + :ivar id: Azure resource Id :vartype id: str - :ivar name: Resource name. + :ivar name: Azure resource name :vartype name: str - :ivar type: Resource type. + :ivar type: Azure resource type :vartype type: str - :param tags: Resource tags - :type tags: dict[str, str] :param linked_resource_id: The resource id of the scoped Azure monitor resource. :type linked_resource_id: str @@ -447,13 +439,12 @@ class ScopedResource(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, 'linked_resource_id': {'key': 'properties.linkedResourceId', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, *, tags=None, linked_resource_id: str=None, **kwargs) -> None: - super(ScopedResource, self).__init__(tags=tags, **kwargs) + def __init__(self, *, linked_resource_id: str=None, **kwargs) -> None: + super(ScopedResource, self).__init__(**kwargs) self.linked_resource_id = linked_resource_id self.provisioning_state = None diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_endpoint_connections_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_endpoint_connections_operations.py index a226ee28cb330..622603c5fcb4a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_endpoint_connections_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_endpoint_connections_operations.py @@ -27,7 +27,7 @@ class PrivateEndpointConnectionsOperations(object): :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: "2019-10-17-preview". + :ivar api_version: Client Api Version. Constant value: "2019-10-17-preview". """ models = models @@ -45,11 +45,10 @@ def get( self, resource_group_name, scope_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): """Gets a private endpoint connection. - :param resource_group_name: The name of the resource group. The name - is case insensitive. + :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param scope_name: Name of the Azure Monitor PrivateLinkScope that - will contain the datasource + :param scope_name: The name of the Azure Monitor PrivateLinkScope + resource. :type scope_name: str :param private_endpoint_connection_name: The name of the private endpoint connection. @@ -68,8 +67,8 @@ def get( # 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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str') } @@ -77,7 +76,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -111,12 +110,14 @@ def get( def _create_or_update_initial( - self, resource_group_name, scope_name, private_endpoint_connection_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, scope_name, private_endpoint_connection_name, private_endpoint=None, private_link_service_connection_state=None, custom_headers=None, raw=False, **operation_config): + parameters = models.PrivateEndpointConnection(private_endpoint=private_endpoint, private_link_service_connection_state=private_link_service_connection_state) + # Construct URL url = self.create_or_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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str') } @@ -124,7 +125,7 @@ def _create_or_update_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -161,21 +162,25 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, scope_name, private_endpoint_connection_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, scope_name, private_endpoint_connection_name, private_endpoint=None, private_link_service_connection_state=None, custom_headers=None, raw=False, polling=True, **operation_config): """Approve or reject a private endpoint connection with a given name. - :param resource_group_name: The name of the resource group. The name - is case insensitive. + :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param scope_name: Name of the Azure Monitor PrivateLinkScope that - will contain the datasource + :param scope_name: The name of the Azure Monitor PrivateLinkScope + resource. :type scope_name: str :param private_endpoint_connection_name: The name of the private endpoint connection. :type private_endpoint_connection_name: str - :param parameters: - :type parameters: - ~azure.mgmt.monitor.v2019_10_17.models.PrivateEndpointConnection + :param private_endpoint: Private endpoint which the connection belongs + to. + :type private_endpoint: + ~azure.mgmt.monitor.v2019_10_17.models.PrivateEndpointProperty + :param private_link_service_connection_state: Connection state of the + private endpoint connection. + :type private_link_service_connection_state: + ~azure.mgmt.monitor.v2019_10_17.models.PrivateLinkServiceConnectionStateProperty :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -194,7 +199,8 @@ def create_or_update( resource_group_name=resource_group_name, scope_name=scope_name, private_endpoint_connection_name=private_endpoint_connection_name, - parameters=parameters, + private_endpoint=private_endpoint, + private_link_service_connection_state=private_link_service_connection_state, custom_headers=custom_headers, raw=True, **operation_config @@ -224,8 +230,8 @@ def _delete_initial( # Construct URL url = self.delete.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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str') } @@ -233,7 +239,7 @@ def _delete_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -261,11 +267,10 @@ def delete( self, resource_group_name, scope_name, private_endpoint_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a private endpoint connection with a given name. - :param resource_group_name: The name of the resource group. The name - is case insensitive. + :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param scope_name: Name of the Azure Monitor PrivateLinkScope that - will contain the datasource + :param scope_name: The name of the Azure Monitor PrivateLinkScope + resource. :type scope_name: str :param private_endpoint_connection_name: The name of the private endpoint connection. @@ -308,11 +313,10 @@ def list_by_private_link_scope( self, resource_group_name, scope_name, custom_headers=None, raw=False, **operation_config): """Gets all private endpoint connections on a private link scope. - :param resource_group_name: The name of the resource group. The name - is case insensitive. + :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param scope_name: Name of the Azure Monitor PrivateLinkScope that - will contain the datasource + :param scope_name: The name of the Azure Monitor PrivateLinkScope + resource. :type scope_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -329,15 +333,15 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_private_link_scope.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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_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', min_length=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_resources_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_resources_operations.py index 6442301ac2644..c4c5a773929dc 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_resources_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_resources_operations.py @@ -25,7 +25,7 @@ class PrivateLinkResourcesOperations(object): :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: "2019-10-17-preview". + :ivar api_version: Client Api Version. Constant value: "2019-10-17-preview". """ models = models @@ -44,11 +44,10 @@ def list_by_private_link_scope( """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - :param resource_group_name: The name of the resource group. The name - is case insensitive. + :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param scope_name: Name of the Azure Monitor PrivateLinkScope that - will contain the datasource + :param scope_name: The name of the Azure Monitor PrivateLinkScope + resource. :type scope_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -65,15 +64,15 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_private_link_scope.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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_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', min_length=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link @@ -119,11 +118,10 @@ def get( """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - :param resource_group_name: The name of the resource group. The name - is case insensitive. + :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param scope_name: Name of the Azure Monitor PrivateLinkScope that - will contain the datasource + :param scope_name: The name of the Azure Monitor PrivateLinkScope + resource. :type scope_name: str :param group_name: The name of the private link resource. :type group_name: str @@ -140,8 +138,8 @@ def get( # 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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'groupName': self._serialize.url("group_name", group_name, 'str') } @@ -149,7 +147,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scope_operation_status_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scope_operation_status_operations.py index 5eece5421950b..592290395b6fc 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scope_operation_status_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scope_operation_status_operations.py @@ -25,7 +25,7 @@ class PrivateLinkScopeOperationStatusOperations(object): :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: "2019-10-17-preview". + :ivar api_version: Client Api Version. Constant value: "2019-10-17-preview". """ models = models @@ -46,8 +46,7 @@ def get( :param async_operation_id: The operation Id. :type async_operation_id: str - :param resource_group_name: The name of the resource group. The name - is case insensitive. + :param resource_group_name: The name of the resource group. :type resource_group_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -63,14 +62,14 @@ def get( url = self.get.metadata['url'] path_format_arguments = { 'asyncOperationId': self._serialize.url("async_operation_id", async_operation_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_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', min_length=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scoped_resources_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scoped_resources_operations.py index 7b4fdbeaa933f..5a98d94c36990 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scoped_resources_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scoped_resources_operations.py @@ -27,7 +27,7 @@ class PrivateLinkScopedResourcesOperations(object): :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: "2019-10-17-preview". + :ivar api_version: Client Api Version. Constant value: "2019-10-17-preview". """ models = models @@ -45,11 +45,10 @@ def get( self, resource_group_name, scope_name, name, custom_headers=None, raw=False, **operation_config): """Gets a scoped resource in a private link scope. - :param resource_group_name: The name of the resource group. The name - is case insensitive. + :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param scope_name: Name of the Azure Monitor PrivateLinkScope that - will contain the datasource + :param scope_name: The name of the Azure Monitor PrivateLinkScope + resource. :type scope_name: str :param name: The name of the scoped resource object. :type name: str @@ -66,8 +65,8 @@ def get( # 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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'name': self._serialize.url("name", name, 'str') } @@ -75,7 +74,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -109,14 +108,14 @@ def get( def _create_or_update_initial( - self, resource_group_name, scope_name, name, tags=None, linked_resource_id=None, custom_headers=None, raw=False, **operation_config): - parameters = models.ScopedResource(tags=tags, linked_resource_id=linked_resource_id) + self, resource_group_name, scope_name, name, linked_resource_id=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ScopedResource(linked_resource_id=linked_resource_id) # Construct URL url = self.create_or_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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'name': self._serialize.url("name", name, 'str') } @@ -124,7 +123,7 @@ def _create_or_update_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -144,7 +143,7 @@ def _create_or_update_initial( 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, 202]: + if response.status_code not in [200, 201, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -153,6 +152,8 @@ def _create_or_update_initial( if response.status_code == 200: deserialized = self._deserialize('ScopedResource', response) + if response.status_code == 201: + deserialized = self._deserialize('ScopedResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -161,19 +162,16 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, scope_name, name, tags=None, linked_resource_id=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, scope_name, name, linked_resource_id=None, custom_headers=None, raw=False, polling=True, **operation_config): """Approve or reject a private endpoint connection with a given name. - :param resource_group_name: The name of the resource group. The name - is case insensitive. + :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param scope_name: Name of the Azure Monitor PrivateLinkScope that - will contain the datasource + :param scope_name: The name of the Azure Monitor PrivateLinkScope + resource. :type scope_name: str :param name: The name of the scoped resource object. :type name: str - :param tags: Resource tags - :type tags: dict[str, str] :param linked_resource_id: The resource id of the scoped Azure monitor resource. :type linked_resource_id: str @@ -194,7 +192,6 @@ def create_or_update( resource_group_name=resource_group_name, scope_name=scope_name, name=name, - tags=tags, linked_resource_id=linked_resource_id, custom_headers=custom_headers, raw=True, @@ -225,8 +222,8 @@ def _delete_initial( # Construct URL url = self.delete.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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'name': self._serialize.url("name", name, 'str') } @@ -234,7 +231,7 @@ def _delete_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -262,11 +259,10 @@ def delete( self, resource_group_name, scope_name, name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a private endpoint connection with a given name. - :param resource_group_name: The name of the resource group. The name - is case insensitive. + :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param scope_name: Name of the Azure Monitor PrivateLinkScope that - will contain the datasource + :param scope_name: The name of the Azure Monitor PrivateLinkScope + resource. :type scope_name: str :param name: The name of the scoped resource object. :type name: str @@ -308,11 +304,10 @@ def list_by_private_link_scope( self, resource_group_name, scope_name, custom_headers=None, raw=False, **operation_config): """Gets all private endpoint connections on a private link scope. - :param resource_group_name: The name of the resource group. The name - is case insensitive. + :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param scope_name: Name of the Azure Monitor PrivateLinkScope that - will contain the datasource + :param scope_name: The name of the Azure Monitor PrivateLinkScope + resource. :type scope_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -329,15 +324,15 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_private_link_scope.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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_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', min_length=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scopes_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scopes_operations.py index 7f4b5fbde9409..6f8773fa09519 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scopes_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scopes_operations.py @@ -11,6 +11,7 @@ import uuid from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -26,7 +27,7 @@ class PrivateLinkScopesOperations(object): :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: "2019-10-17-preview". + :ivar api_version: Client Api Version. Constant value: "2019-10-17-preview". """ models = models @@ -53,21 +54,20 @@ def list( :return: An iterator like instance of AzureMonitorPrivateLinkScope :rtype: ~azure.mgmt.monitor.v2019_10_17.models.AzureMonitorPrivateLinkScopePaged[~azure.mgmt.monitor.v2019_10_17.models.AzureMonitorPrivateLinkScope] - :raises: - :class:`ErrorResponseException` + :raises: :class:`CloudError` """ def prepare_request(next_link=None): 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) + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_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', min_length=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link @@ -93,7 +93,9 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp return response @@ -110,8 +112,7 @@ def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): """Gets a list of Azure Monitor PrivateLinkScopes within a resource group. - :param resource_group_name: The name of the resource group. The name - is case insensitive. + :param resource_group_name: The name of the resource group. :type resource_group_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -121,22 +122,21 @@ def list_by_resource_group( :return: An iterator like instance of AzureMonitorPrivateLinkScope :rtype: ~azure.mgmt.monitor.v2019_10_17.models.AzureMonitorPrivateLinkScopePaged[~azure.mgmt.monitor.v2019_10_17.models.AzureMonitorPrivateLinkScope] - :raises: - :class:`ErrorResponseException` + :raises: :class:`CloudError` """ def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_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', min_length=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link @@ -162,7 +162,9 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp return response @@ -181,15 +183,15 @@ def _delete_initial( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'scopeName': self._serialize.url("scope_name", scope_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', min_length=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -205,7 +207,9 @@ def _delete_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: - raise models.ErrorResponseException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp if raw: client_raw_response = ClientRawResponse(None, response) @@ -215,8 +219,7 @@ def delete( self, resource_group_name, scope_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a Azure Monitor PrivateLinkScope. - :param resource_group_name: The name of the resource group. The name - is case insensitive. + :param resource_group_name: The name of the resource group. :type resource_group_name: str :param scope_name: The name of the Azure Monitor PrivateLinkScope resource. @@ -230,8 +233,7 @@ def delete( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`ErrorResponseException` + :raises: :class:`CloudError` """ raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -259,8 +261,7 @@ def get( self, resource_group_name, scope_name, custom_headers=None, raw=False, **operation_config): """Returns a Azure Monitor PrivateLinkScope. - :param resource_group_name: The name of the resource group. The name - is case insensitive. + :param resource_group_name: The name of the resource group. :type resource_group_name: str :param scope_name: The name of the Azure Monitor PrivateLinkScope resource. @@ -274,21 +275,20 @@ def get( :rtype: ~azure.mgmt.monitor.v2019_10_17.models.AzureMonitorPrivateLinkScope or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` + :raises: :class:`CloudError` """ # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'scopeName': self._serialize.url("scope_name", scope_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', min_length=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -305,7 +305,9 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None if response.status_code == 200: @@ -324,8 +326,7 @@ def create_or_update( specify a different value for InstrumentationKey nor AppId in the Put operation. - :param resource_group_name: The name of the resource group. The name - is case insensitive. + :param resource_group_name: The name of the resource group. :type resource_group_name: str :param scope_name: The name of the Azure Monitor PrivateLinkScope resource. @@ -343,23 +344,22 @@ def create_or_update( :rtype: ~azure.mgmt.monitor.v2019_10_17.models.AzureMonitorPrivateLinkScope or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` + :raises: :class:`CloudError` """ azure_monitor_private_link_scope_payload = models.AzureMonitorPrivateLinkScope(location=location, tags=tags) # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'scopeName': self._serialize.url("scope_name", scope_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', min_length=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -379,12 +379,16 @@ def create_or_update( 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) + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureMonitorPrivateLinkScope', response) + if response.status_code == 201: + deserialized = self._deserialize('AzureMonitorPrivateLinkScope', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -398,8 +402,7 @@ def update_tags( """Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. - :param resource_group_name: The name of the resource group. The name - is case insensitive. + :param resource_group_name: The name of the resource group. :type resource_group_name: str :param scope_name: The name of the Azure Monitor PrivateLinkScope resource. @@ -415,23 +418,22 @@ def update_tags( :rtype: ~azure.mgmt.monitor.v2019_10_17.models.AzureMonitorPrivateLinkScope or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` + :raises: :class:`CloudError` """ private_link_scope_tags = models.TagsResource(tags=tags) # Construct URL url = self.update_tags.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'scopeName': self._serialize.url("scope_name", scope_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', min_length=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -452,7 +454,9 @@ def update_tags( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None if response.status_code == 200: diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/version.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/version.py index e4f3d50553034..3697d9b717398 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/version.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.8.0" +VERSION = "0.9.0"